Event handler Example
Answer / hrpatelsoft@gmail.com
<html>
<head>
<title>DOM!!!</title>
</head>
<body>
<input type="button" id="btnClick" value="Click Me!!" />
<script type="text/javascript">
document.getElementById("btnClick").addEventListener("click", clicked);
function clicked()
{
alert("You clicked me!!!");
}
</script>
</body>
</html>
Is This Answer Correct ? | 0 Yes | 0 No |
What is the difference between scripting and programming?
What are the main features of javascript?
Explain promise in javascript?
Write a way by which you can do something on the close of the window ?
What is the reason for wrapping the entire content of a javascript source file in a function book?
What is jscript used for?
What are the methods of validating whether the form is secure?
How javascript sort function works?
Explain escape() in javascript?
Explain event bubbling and event capturing in javascript?
How do I open javascript in browser?
How to redirect a url using JavaScript?