Write a function that responds to a click anywhere on the
page by displaying an alert dialog. Display the event name
if the user held Shift during the mouse click. Display the
element name that triggered the event if the user held Ctrl
during the mouse click. (Answer in Java Language)
Answers were Sorted based on User's Feedback
Answer / anil
<html>
<head>
<title>Mouse Events Example</title>
<script type="text/javascript">
function handleEvent(oEvent) {
var oTextbox = document.getElementById("txt1");
oTextbox.value += "\n button down is " +
oEvent.button;
var arrKeys = [];
if (oEvent.ctrlKey) {
arrKeys.push("Ctrl");
}
oTextbox.value += "\n keys down are " + arrKeys;
}
</script>
</head>
<body>
<P>Use your mouse to click and double click the red square.</p>
<div style="width: 100px; height: 100px; background-color: red"
onclick="handleEvent(event)"
id="div1"></div>
<P><textarea id="txt1" rows="15" cols="50"></textarea></p>
</body>
</html>
Is This Answer Correct ? | 14 Yes | 13 No |
Answer / anil yadav
<html>
<head>
<title>Mouse Events Example</title>
<script type="text/javascript">
function handleEvent(oEvent) {
var oTextbox = document.getElementById("txt1");
oTextbox.value += "\n button down is " +
oEvent.button;
var arrKeys = [];
if (oEvent.ctrlKey)
{
arrKeys.push("Ctrl");
}
if (oEvent.shiftKey)
{
arrKeys.push("Shift");
}
oTextbox.value += "\n keys down are " + arrKeys;
}
</script>
</head>
<body>
<P>Use your mouse to click and double click the red
square.</p>
<div style="width: 100px; height: 100px; background-color:
red"
onclick="handleEvent(event)"
id="div1"></div>
<P><textarea id="txt1" rows="15" cols="50"></textarea></p>
</body>
</html>
Is This Answer Correct ? | 5 Yes | 7 No |
plz plz help me "how can i face dell varcent round"....? plzzzzzzzz help me friends.....?
What is a superheterodyne receiver?
successful command to make linux system as router in redhat-+
What is the meaning of int p(char*a);
Paul the octopus who has been forecasting the outcome of FIFA world cup matches with tremendous accuracy has now been invited to predict ICC world cup matches in 2011. We will assume that the world cup contenders have been divided into 2 groups of 9 teams each. Each team in a group plays the other teams in the group. The top two teams from each group enter the semi finals ( after which the winner is decided by knockout). However, Paul has a soft spot for India and when India plays any team, Paul always backs India. Alas, his predictions on matches involving India are right only 2 out of 3 times. In order to qualify for the semi finals, it is sufficient for India to win 7 of its group matches. What is the probability that India will win the ICC world cup?
What is the difference between Huawei 5700 switch and 5300 switch?
PLC Training in chennai ? Best PLC Training center in chennai?
is it possible to get u.s visa with 55% in b-tech and 15 backlogs
explain various object oriented programming fetures
Dear sir 1: i know about IIT & AIEEE prepration which city is best and top 1 position ? 2: Top 10 institute in INDIA for prepration to IIT & AIEEE plz get me detail knowldge? 3: where is better invoirnment availble for IIT & AIEEE entrance exam? 4: What diffrent between KOTA & DELHI institute and enviornment
what is the difference between C and C++? what is the difference between scanf and gets? what is mean by extern what is the use of it? what will happen if i say delete this> Difference between C structure and C++ structure? What is the difference between overloading and overridding? Explain the need for "virtual Destructor" Can we have "virtual Constructors"? What is the different types of polymorphism> What is virtual functions? How to implement virtual function in "C"? What are the different types of storage classes?
project plan for bug tracking system?