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 |
How to find operating system in the client machine using javascript?
What do you understand by this keyword in javascript?
What does break and continue statements do in javascript?
How to write html code dynamically using JavaScript?
What is enum data type?
What is difference == and === in javascript?
What are the ways of making comments in javascript?
How do you implement Ajax using hide() function in JQuery?
How to define a anonymous function?
What is the use of a weakset object in javascript?
What are self Executing Functions?
Which built-in method returns the length of the string?