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's Prototypes for JavaScript
What is the difference between the substr() and substring() functions in javascript?
Is javascript object oriented?
What is the function of deferred scripts?
why we use javascript in html ?
What is difference between deep and shallow object coping in javascript?
What is javascript used for on iphone?
How to define a anonymous function?
How to call a function in every x seconds in javascript?
What is the difference between ‘function declaration’ and ‘function expression’?
How do I disable javascript in my browser?
What are classes in javascript?