What is the true difference between document.getElementById('SOMEID') and $("[id$='SOMEID']")
?
What is the true difference between document.getElementById(‘SOMEID’) and $([id$=’SOMEID’]) ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
$(..)variant uses jQuery, which allows you to use selectors to find what you are searching for (class, id, tag etc). ThegetElementById()is plain javascript which obviously only searches by element id.You can learn more about jQuery’s support for selectors in this official jQuery tutorial.