Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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)

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

hello sir,pls fdorward previous group-I exam papers .....

1938


Please explain me gsm call scenario for a prepaid roamer calling to a prepaid roamer?

2514


what is the difference between core java and advance java

2126


Hi All... PLease send me if anyone have "Information Security Officer" Aptitude papers. Please Mail me at mannusanghi@gmail.com

1859


what is the proper location of sample point for sphere tank?

1980


how u test the idoc in inbound and outbound?

2053


How can I get know that my pc contains dram or sram..?

1918


Please. Does someone know how to inicialize tapes in ATL? I need have 100 tapes to init inside the ATL, how is the process to complete this request?

2071


what are differences between composition and inheritance in c

1555


I have file with input as below : Name Value Rohan 12,13,14 Rohit 1,2,3 Output should be : Rohan 12 Rohan 13 Rohan 14 Here how will the normalize component work? Thanks

1355


which are the books available in, India for STONE COLUMNS/GRANULAR PILES?

1758


If you were to drill a circular hole in a sheet of metal and then heat the sheet, what would happen to the size of the hole?

1131


what are the artifacts in coding phase in SDLC????

2203


what is the difference between oracle 8i vs 9i

2236


Hi my dears I have 2 questions. 1- how many types of test are there at all? 2- how can I define test characteristics (such as test duration and parameter severity)in developing a modern technological equipment? I tanks you for introducing or sending a text handbook or guidebook file for me. thanks for your coming answers. yours sincerely

2238