troubleshooting Question

Tracking mouse events

Avatar of pvg1975
pvg1975Flag for Argentina asked on
JavaScript
9 Comments1 Solution198 ViewsLast Modified:
Hello again guys!

I have the following code to capture keystrokes:

<html>
<head>
<title>Lakio- where onkey?</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
document.onkeyup=function(e){
var keyCode = (document.layers) ? keyStroke.which : event.keyCode;
who=document.activeElement?document.activeElement:e.target;
alert(who.name + " - " + who.value);
}
</script>
</head>

<body>
<form name="form1" method="post" action="">
  <p>
    <input name="textfield" type="text" value="11111111">
    <input name="textfield2" type="text" value="22222222222">
    <input name="textfield3" type="text" value="333333333333333333">
    <input name="textfield4" type="text" value="44444444444444">
  </p>
</form>
</body>
</html>

In the same code, I need to capture mouse events on other controls, as for example when a user clicks on a checkbox, radiobutton or selects an item from a list.

Any suggestions?

Thanks!
ASKER CERTIFIED SOLUTION
Lakio

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros