No much to
say,
onclick="alert('1')" />
The
alert message is null
instead of a message contain details of
the object or something like that.
What is the
problem?
Answer
Put your script AFTER the actual element,
otherwise by the time your javascript code runs, there's not yet such element in the
DOM.
onclick="alert('1')" />
Alternatively
put your script in a DOM ready event to ensure that the DOM is fully loaded by the
browser before attempting to manipulate
it:
value="Clickme" onclick="alert('1')" />
No comments:
Post a Comment