When should you use document.all vs. document.getElementById?
When should you use document.all vs. document.getElementById ?
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.
document.allis a proprietary Microsoft extension to the W3C standard.getElementById()is standard – use that.However, consider if using a js library like jQuery would come in handy. For example,
$("#id")is the jQuery equivalent forgetElementById(). Plus, you can use more than just CSS3 selectors.