Event handler Example



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

Post New Answer

More JavaScript Interview Questions

What will happen if an infinite while loop is run in Javascript?

0 Answers  


What is double exclamation point?

0 Answers  


How can we establish connection with java and sql server?

0 Answers   TCS,


What is variable typing?

0 Answers  


What close() does in javascript?

0 Answers  






What is console.log() and why it is used?

0 Answers  


What is an object in javascript, give an example?

0 Answers  


What are ‘settimeout()’?

0 Answers  


What is the difference between undeclared & undefined?

0 Answers  


What is the javascript function?

0 Answers  


How to find operating system in the client machine using javascript?

0 Answers  


Event handler Example

1 Answers  


Categories