jQuery vs javaScript and samples
jQuery is the wrapper on JavaScript. Meaning jQuery is the wrapper for the raw DOM objects returned by JavaScript.
Since we get jQuery object bag, so we could use methods like css, etc., These methods are not available on the raw DOM object.
document.getElementById('id') is faster than $('#id'). So use javascript, when there is simple work like using css or retrieving values.
And use jQuery, if there is any complex functionality is involved and to use minimal coding.
Also this is easy for the developers
Since we get jQuery object bag, so we could use methods like css, etc., These methods are not available on the raw DOM object.
document.getElementById('id') is faster than $('#id'). So use javascript, when there is simple work like using css or retrieving values.
And use jQuery, if there is any complex functionality is involved and to use minimal coding.
Also this is easy for the developers
Comments
Post a Comment