Answer Posted / 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 View All Answers
How to get inner html of an element in javascript?
Is function a data type in javascript?
What are the pop-up boxes available in javascript?
How do you write a comment in javascript?
What is the function of javascript?
What is break and continue statements?
What is closure? Give an example.
How to get checkbox status whether it is checked or not?
How do I view javascript in chrome?
What are events in javascript?
What are the seven data types of javascript?
What are the types of variables in javascript?
What are the five data types?
What is the use of a set object in javascript?
What is a method in javascript?