Answer Question
How do I add methods to DOM element objects in javascript?
I am a bit confused by this - I have been trying to add a method that will return true or false whether an element (retrieved with document.getElementById("example")) has a specified class name assigned.
I have tried with the "prototype" method and without - I have used "= new Function(string)" and "= function(){}" syntax and sometimes it works in one browser, sometimes in another, but I can't figure out why or why not.
Please shed some light on this for me; this is what I want to do:
x = document.getElementById("example");
if (x.hasClassName("test"))
{
}
(and I am not interested in an alternative way to do it...)
TEXT
Uploading file and scanning for virus...
Please Wait