Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Top World Wide Web Interviews:Action ScriptAJAXBasic InternetBloggingCascading Style Sheet CSSCSS3DHTMLDomain Name System (DNS)EcommerceHTMLHTML5JavaScriptjQueryjQuery KnockoutJSONJSONPUser Interface DesignerVBScriptW3CWeb 2.0 TechnologiesWeb 3.0 TechnologiesWeb BuildingWeb DevelopersWeb QualityWeb SecurityWeb SemanticWebmaster
Copyright © 2018. All Rights Reserved
DHTML Interview Question:
How to Handle Events with DHTML?
Submitted by: AdministratorEvent 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
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
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.