I have the following code in a .js file:
function clearVillage()
{
/*Do Something...*/
}
Now in my HTML page generate through PHP, If I call this function through a link like this:
<a class="fg-button ui-state-default ui-corner-all" onclick="clearVillage();" >Clear Village</a>
It works. However, if I replace the link with a button:
<input type="button" name="clearVillage" value="Clear Village" onclick="clearVillage()" />
It stops working. I get the error: clearVillage is not a function Line 1
Suggestions??