Interviewer And Interviewee Guide

DHTML Interview Question:

How to Handle Events with DHTML?

Submitted by: Administrator
Event is use to trigger actions in the browser. When client click on the element, associated action will started.Like: an JavaScript will started when client click on element.
Using Event Handler we can do like that,When an event occur it will execute code associated with that element.
Example:
In this example header will changes when client clicks.
<h1 onclick="this.innerHTML='abc!'">Click on this text</h1>
We can add a script in the head section and then we call the function from the event handler.
Example:
<html>
<head>
<script type="text/javascript">
function changetext(id)
{
id.innerHTML="abc!";
}
</script>
</head>
<body>
<h1 onclick="changetext(this)">Click on this text</h1>
</body>
</html>
Submitted by: Administrator

Read Online DHTML Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.