Saturday, July 14, 2018

What is the difference between using jQuery and plain Javascript?




Can somebody explain to me what the difference is between these two examples:




var obj = getElementById("id1"); // without jQuery
var obj = $("#id1"); // with jQuery


Is the returned value in both cases the same object?


Answer



getElementById() returns a DOM element only, $("#id1") returns a jQuery object containing DOM element(s).


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...