Can I use the onClick event for plain text?
Posted on 2004-04-21
trying to call a function through the onClick event of text.
Another question is, can I declare the variable numsquare this way (inside the alert mehtod)?
I want to link text to the function. Something like;
<onclick=squareit(), "Square any number">
Am I at least close? :-(
Here's the function I wrote:
alert(var numsquare = prompt("Please enter in any number to be squared.") + "Thank you, " + numsquare + " squared is " + numsquare * numsquare ".")