A simple comparison on jQuery notations with classic JavaScript;
1.
How to refer to the DOM?
jQuery:
$(document)
JavaScript:
document
2. Page Load
jQuery:
$(document).ready(function(){ … });
JavaScript:
Window.onload = function(){
… };
3.
How to refer to an element in the page by Id?
jQuery:
$(“#ELEMENT_ID”);
JavaScript:
document.getElementById(“ ELEMENT_ID“);
4.
How to refer to the elements in a page by tag name?
jQuery:
$(“input”);
JavaScript:
document.getElementsByTagName(“input”);
This comment has been removed by the author.
ReplyDeleteThank you for the comment. The like is a very useful one and is a very neatly written article. Wish to write up to the same standard one fine day.
Delete