In plain old HTML the following code will work:
<input type="button" value="click" onClick="function()" />
However; in XHTML Strict 1.0 this code will not validate, saying that “there is no function onClick”. I know that this code here will work,
<a href="javascript:function()>click</a>
But I want the function to occur on the click of a button.
It’s
onclick(all lower case) in XHTML, which is case-sensitive. (Reference) So for instance (live copy):