Professional Documents
Culture Documents
etc.
Syntax:
<!DOCTYPE html>
<html>
<head>
<title>HTML Page</title>
</head>
<body>
<h1>Hello World</h1>
<div>
<p>This is a paragraph tag.</p>
</div>
</body>
</html>
What is DHTML?
documents.
It enables programmers to apply effects to their pages.
rollover buttons.
This term also describes the development of numerous browser-
Conclusion
HTML is used to create the layout of static web pages,
What is jQuery
The jQuery website defines jQuery (jQ) as “a fast and concise JavaScript
Library that simplifies HTML document traversing, event handling,
animating, and Ajax interactions for rapid web development.”.
jQuery is not a programming language instead, it is a cross-platform
JavaScript library. There are many other JavaScript libraries available,
like MooTools, Knockout, or even Angular (Though Angular uses
TypeScript, it compiles to JavaScript at the end), and jQuery is one of
the most popular among them.
jQuery is a fast, feature-rich JavaScript library. It is created to help
programmers with creating a familiar UI and take care of browser
compatibility issues more efficiently.
jQuery, in fact, is nothing but JavaScript. All the code you write in
jQuery is converted to JavaScript internally. One line of code written
using jQuery may be equal to many lines of code written using
JavaScript which means programmers will have to write only lesser
lines of code.
To start using jQuery on your page, you need to include one line of
code in the header of your page, like,
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-
3.2.1.min.js"></script >
The above line includes a jQuery library for your page using the
Microsoft CDN (Content Delivery Network). The jQuery library is a
single JavaScript file.
You can also include the jQuery library as a local resource from your
project folder.
But there are benefits to using the CDN. If you use the minified library
version, you will get the advantage of concurrent connections and
multiple servers.
JavaScript Vs. jQuery
Now, we can discuss the questions mentioned at the beginning of this
article. Most of those questions may arise because of the lack of a clear
understanding of JavaScript and jQuery.
Since jQuery is nothing but a library of JavaScript, it cannot replace
JavaScript. All jQuery code is JavaScript, but jQuery doesn’t include all
the JavaScript code.
One thing you should understand is that they are not two
programming languages; instead, they both are JavaScript. jQuery is
just optimized to do the common scripting functions with fewer lines of
code.
Lines of code
Many actions like Animate, Delay and Fade-In can be done using jQuery
with very few lines of code. On the other hand, JavaScript will take lots
of lines of code for the same.
We can consider a more straightforward example,
Suppose I want to select all elements having class- simple-li,
If I use JavaScript,
document.getElementsByClassName("simple-li");
On the other hand, if I use jQuery,
$('simple-li')
Performance
If you check the performance of the two, you can find that plain
JavaScript is faster than jQuery for accessing DOM. But JavaScript can
be slower when you write some complex logic because we may make
significant mistakes or use poor code, which may lead to a
performance hit. On the other hand, jQuery has been tested for years
to use the best and fast JavaScript codes.
In my view, it is not right to compare the two, or you cannot say one is
better than the other. We need to use whichever is better suited to our
requirements.
Advantages of jQuery
You can code the most common JS actions using jQuery with
Conclusion
jQuery is well suited for most applications, especially ones that need
rapid development. jQuery takes care of common browser errors by
ironing the fixes right into the library. jQuery also takes care of browser
compatibility issues which are a developer’s nightmare during
deployment.
Using JavaScript or jQuery really depends on your need and other
factors. Most web development projects will work perfectly fine using
jQuery. But there will be a small percentage that does require
JavaScript.
Since pure JavaScript is the best-performing method of client-side
development, there is a reason to use it. But a library like jQuery will
help you to get to market faster and cheaper. So, it is better to depend
heavily on jQuery for the initial versions of your product. Once your
product is established in the marked and you have the revenues to go
back and refactor the code, you can custom code all the script.