Can the DOM be accessed through document.getElementID functions in the .js file. I had written about this in the previous post, but ...
This will help in removing the onclick attributes in the HTML tags.
Yes the DOM can be accessed through document.getElementID functions in .js files
Could yuo give an example?
So the initial code should be a procedural inline code in the .js file, i.e should not be a part of any function. Right ?
Here's a sample.
No, thats not what I meant.
Assume there is this .js file, which goes on like this:
Now, my question is the 'document.onclick...' line executed WITHOUT any calls in the HTML file ? The HTML file will have nothing else other than the <script> element.
Is this possible. It is NOT within any function. So..., could you help me with that ?
I think what you need to look into is event listeners.
Heres one method which seems to works in Netscape 6, and in IE >4