Interviewer And Interviewee Guide

JavaScript Interview Question:

How to have an element invoke a JavaScript on selection, instead of going to a new URL?

Submitted by: Administrator
<script type="text/javascript">
function pseudoHitMe() {
alert("Ouch!");
}
</script>
<a href="javascript:pseudoHitMe()">hit me</a>
Submitted by: Administrator

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