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? -

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

ajax - PHP/JSON Login script (Twitter style) not setting sessions -