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

how to find out the name of the users who are currently working starting with the same characters in unix os

1726


Let an denote the number of bit strings of length n that do not have two consecutive zeroes. Find a recurrence relation for the number of bit strings of length n that do not have two consecutive zeroes. Hence find a4.

2126


what are all the browsers..?

1640


how can one get scholership based on gre score ang how much scholarship one can get, plz suggest the way one can apply and get scholarship

3025


how to reuse an outdated laptop?

1753


hi , anyone plz end nic model papers to my id

1727


plz tell me which books r important for gate exam (CSE)

2138


I am having 5 nos. ceiling fans in my home. if i switch on all fan at full speed say 5 , so Will my meter reading be runing fast ? OR if I keep all fans on very low speed, say 1, so meter reading will runing slowly. or it does not make any difference whether low or high. reading will remain same?

1586


what are the advantages as disadvantages of the V-model?

1822


Why did they used to make the mill chimneys so tall?

1067


i am satish i want to preapare for group-1 exams so please help me?

1742


how am i supposed to convert a class program in C++ to Matlab? Do i also need to make classes in matlab too or I can do it without making classes???Can somebody help....

1521


what is your experience with computer-aided design software.

1684


How does C pass variables to a function ?

1799


Question 1 A low-level format received by a floppy disk does what? a. Adds a root directory b. Includes a FAT (File Allocation Table) c. Stores 720K d. Creates a structure of sectors, tracks, & cluster. Question 2 A user is complaining of problems. You find that upon startup, the IBM machine give two beeps alerting you to a POST error. Error code 301 shows. What is wrong with this machine? a. There is a monitor error. b. There is a keyboard error. c. This is not a POST error. Two beeps indicates a motherboard error. d. There is a serial card error. Question 3 What is this an example of? A. A 30-pin SIMM B. A 72-pin SIMM C. A 168-pin DIMM D. C-RIMM Question 4 Bridges are capable of which? a. Expanding the length of a network segment. b. Acting as a firewall. c. Segmenting networks. d. Communication of computers on a LAN. Question 5 Which is true of a female DB 15-pin video port? a. It has 2 rows of 5 pinholes. b. It has 3 rows of 5 pinholes. c. It has one row of 8 pinholes and one row of 7 pinholes d. It has one row of 6 pinholes and one row of 9 pinholes Question 6 You have just installed two hard drives into the same machine. One is set up as the slave and both are on the same IDE channel. You notice that the drive's LED light is constantly lit on the slave drive. What do you need to do to fix this? a. Troubleshoot the slave drive by reconfiguring the slave to be the master, removing the original master drive, then rebooting. b. Disable the secondary controller in the BIOS. c. Manually enter the drive settings on the BIOS. d. Install more memory. Question 7 SVGA and Ultra VGA are two distinct video standards. True or False? a. True. b. False. Question 8 SVGA is represented by all of the following resolutions except: a. 1600 x 1200 b. 800 x 600 c. 640 x 480 d. 1280 x 1024 Question 9 Which is true of an Active Matrix LCD? a. The LCD is divided into two halves. b. The LCD is divided into two halves. c. Each pixel is constantly refreshed. d. The pixels are fixed. e. It uses more electricity. f. None of the above. Question 10 What are the correct stages and order of the EP laser printing process? a. Cleaning, Writing, Conditioning, Developing, Fusing, Transferring, and End of Cycle b. Cleaning, Conditioning, Writing, Developing, Transferring, Fusing, & End of Cycle c. Erasing, Writing, Heating, Developing, Fusing, Transferring, & End of Cycle d. Conditioning, Erasing, Writing, Developing, Fusing, Transferring, & End of Cycle Question 11 Choose the correct associations (pick 2). a. 802.4 – Internetworking b. 802.6 - Metropolitan area network c. 802.9 - Integrated voice and data networks d. 802. 11 - Token ring LAN Question 12 What is the function of a Layer 2 switch ? a. forwards data based on logical addressing b. duplicates the electrical signal of each frame to every port c. learns the port assigned to a host by examining the destination MAC address d. determines which interface is used to forward a frame based on the destination MAC address. Question 13 An administrator would like to connect ten workstations on a 192.168.0.0/24 network. The device selected by the administrator must allow connectivity between hosts without sharing bandwidth. Which device would be appropriate? a. Hub b. Router c. Switch d. Repeater Question 14 Which devices are primarily used to extend cable segments within a collision domain by regenerating the data signals? (Choose two.) a. switch b. repeater c. router d. bridge e. hub Question 15 Which networking devices use the MAC address to make forwarding decisions? (Choose two.) a. NIC b. bridge c. hub d. switch e. repeater Software : 1. Briefly describe the data type conversion feature of Oracle SQL and PL/SQL. 2. What is INDEX? Describe its benefits. 3. Write down the name of five most popular RDBMS. 4. What is UML? Write some Diagram name. 5. What is HTML and XML? 6. What is CSS and AJAX and their benefits? 7. What is software quality assurance? 8. Describe components of a typical test plan? 9. What is the difference between QC and QA? 10. What is Verification and Validation? 11. What diff b/w black box and white box testing? 12. What is the difference between System Testing, Integration Testing & System Integration Testing? ATI Limited Question Paper Duration Time : 1 Hour and 30 Minutes Question 1 A low-level format received by a floppy disk does what? a. Adds a root directory b. Includes a FAT (File Allocation Table) c. Stores 720K d. Creates a structure of sectors, tracks, & cluster. Question 2 A user is complaining of problems. You find that upon startup, the IBM machine give two beeps alerting you to a POST error. Error code 301 shows. What is wrong with this machine? a. There is a monitor error. b. There is a keyboard error. c. This is not a POST error. Two beeps indicates a motherboard error. d. There is a serial card error. Question 3 What is this an example of? A. A 30-pin SIMM B. A 72-pin SIMM C. A 168-pin DIMM D. C-RIMM Question 4 Bridges are capable of which? a. Expanding the length of a network segment. b. Acting as a firewall. c. Segmenting networks. d. Communication of computers on a LAN. Question 5 Which is true of a female DB 15-pin video port? a. It has 2 rows of 5 pinholes. b. It has 3 rows of 5 pinholes. c. It has one row of 8 pinholes and one row of 7 pinholes d. It has one row of 6 pinholes and one row of 9 pinholes Question 6 You have just installed two hard drives into the same machine. One is set up as the slave and both are on the same IDE channel. You notice that the drive's LED light is constantly lit on the slave drive. What do you need to do to fix this? a. Troubleshoot the slave drive by reconfiguring the slave to be the master, removing the original master drive, then rebooting. b. Disable the secondary controller in the BIOS. c. Manually enter the drive settings on the BIOS. d. Install more memory. Question 7 SVGA and Ultra VGA are two distinct video standards. True or False? a. True. b. False. Question 8 SVGA is represented by all of the following resolutions except: a. 1600 x 1200 b. 800 x 600 c. 640 x 480 d. 1280 x 1024 Question 9 Which is true of an Active Matrix LCD? a. The LCD is divided into two halves. b. The LCD is divided into two halves. c. Each pixel is constantly refreshed. d. The pixels are fixed. e. It uses more electricity. f. None of the above. Question 10 What are the correct stages and order of the EP laser printing process? a. Cleaning, Writing, Conditioning, Developing, Fusing, Transferring, and End of Cycle b. Cleaning, Conditioning, Writing, Developing, Transferring, Fusing, & End of Cycle c. Erasing, Writing, Heating, Developing, Fusing, Transferring, & End of Cycle d. Conditioning, Erasing, Writing, Developing, Fusing, Transferring, & End of Cycle Question 11 Choose the correct associations (pick 2). a. 802.4 – Internetworking b. 802.6 - Metropolitan area network c. 802.9 - Integrated voice and data networks d. 802. 11 - Token ring LAN Question 12 What is the function of a Layer 2 switch ? a. forwards data based on logical addressing b. duplicates the electrical signal of each frame to every port c. learns the port assigned to a host by examining the destination MAC address d. determines which interface is used to forward a frame based on the destination MAC address. Question 13 An administrator would like to connect ten workstations on a 192.168.0.0/24 network. The device selected by the administrator must allow connectivity between hosts without sharing bandwidth. Which device would be appropriate? a. Hub b. Router c. Switch d. Repeater Question 14 Which devices are primarily used to extend cable segments within a collision domain by regenerating the data signals? (Choose two.) a. switch b. repeater c. router d. bridge e. hub Question 15 Which networking devices use the MAC address to make forwarding decisions? (Choose two.) a. NIC b. bridge c. hub d. switch e. repeater Software : 1. Briefly describe the data type conversion feature of Oracle SQL and PL/SQL. 2. What is INDEX? Describe its benefits. 3. Write down the name of five most popular RDBMS. 4. What is UML? Write some Diagram name. 5. What is HTML and XML? 6. What is CSS and AJAX and their benefits? 7. What is software quality assurance? 8. Describe components of a typical test plan? 9. What is the difference between QC and QA? 10. What is Verification and Validation? 11. What diff b/w black box and white box testing? 12. What is the difference between System Testing, Integration Testing & System Integration Testing?

6694