JavaScript call function not working - simple example -


i trying call javascript function (plain old js.. not jquery or other library) having issues. seems simple maybe doing silly. have html element id of testbutton. here javascript..

document.getelementbyid("testbutton").onclick = function() { makerequest('test.html'); }; function makerequest(url) {     alert('clicked'); } 

it's onclick, not onclick

document.getelementbyid("testbutton").onclick = function() { makerequest('test.html'); };  function makerequest(url) {     alert('clicked'); } 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -