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 create a function in javascript?
How to add behavior to an element using javascript?
hi iM rahul.my questions is my project is a web based & developed using java,jsp. when i record it using qtp what script i will get like either browser("jdfjkf").page("nkf").... or javawindow("f d ").javaedit("Dasf").... plz clarify my doubt asap and i also need some vbscipt of java coding?
Entire content of a JavaScript source file in a function block?
How do I unblock javascript in chrome?
Can you assign a anonymous function to a variable?
What's math constants and functions using javascript?
Why javascript is not secure?
Is notepad ++ an ide?
What is use of settimeout function in javascript?
What is arguments object in JavaScript?
Explain export & import in javascript?
What is encodeuri() function?
Is there any class in javascript?
How do you submit a form using JavaScript?