If you're new here, you may want to subscribe to my RSS feed. So that you can read the latest updates about Web2.0 tools, Making Money Online, Tips in SEO, Ajax and many more. Thanks for visiting ProgramimiCOM!
A common mistake made in JavaScript is the difference between names and IDs. In some browsers you are able to directly access an element by its ID such as:
document.id.(attribute)
However, that doesn’t work in all browsers and therefore should not be used. The correct way to access an element by its ID is with the function getElementById(), which is actually quite easy to remember if you think about it
. This would be the way to use it:
document.getElementById(‘id’).(attribute)
Generally when the name attribute is used it’s for forms, and thus requires the name of the form to be called as well. The structure for this is:
document.formName.elementName.(attribute)
It’s a pretty simple concept, however it’s often misused, so make sure you know what you’re trying to do before you do it!
Print This Post
Email This Post
Comments RSS
TrackBack Identifier URI
You must be logged in to post a comment.