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 use of a number object in javascript?
Does javascript care about whitespace?
How can you set position of the page (top and left) to 0 using javascript in one line code?
How do I use javascript to password-protect my web site?
How long does it take to learn coding?
What is null in javascript?
Explain unescape() and escape() in javascript?
How to validate email in javascript?
What is a “closure” in JavaScript? Provide an example
What does three dots mean in texting?
Is javascript safe to download?
Can you access Cookie using javascript?