Javascript code: function doClick() { alert('clicked'); } HTML code:
Copy
and then the javascript:
function doClick()
{
alert("I've been clicked");
}
And that works for me :)
Solution 2:
the submit button already has a default functionality . it wont trigger the onclick function in many browsers. try changing the button type to 'button' and try to submit the form using javascript.
Solution 3:
For your sample. It should work.
There are two things you should be sure:
When you click the button, make sure that the Javascript code has
been loaded.
Your Javascript code must not have any syntax error.
If the button is inside a form, after clicked, the form could be submitted.
Share
Post a Comment
for "Onclick Button Input Not Working In Chrome"
Post a Comment for "Onclick Button Input Not Working In Chrome"