Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to link js function to button

//- Using a function pointer:
document.getElementById("clickMe").onclick = doFunction;

//- Using an anonymous function:
document.getElementById("clickMe").onclick = function () { alert('hello!'); };
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #link #js #function #button
ADD COMMENT
Topic
Name
3+7 =