What is difference between
document.getElementById(“selAge”) document.myForms.selAge
When to use which?
They are two different paths to the same goal, which one you use depends on your preference. Personally I would use document.getElementById(“selAge”) because if the structure of your HTML changes then it would still work.
document.getElementById(“selAge”)
2.1m questions
2.1m answers
60 comments
57.0k users