Hi there Acey99,
have a look at this example, it may give you some ideas...
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
form {
width:270px;
}
#stuff {
width:500px;
text-align:justify;
margin-top:40px;
}
-->
</style>
<script type="text/javascript">
<!--
function elemId(ev) {
el=(ev.target)?ev.target:ev.srcElement;
if(el.id!='') {
document.getElementsByTagName('textarea')[0].value=
'Your mouse is on the '+el.tagName+'\nit\'s id is "'+el.id+'"';
}
if(el.tagName=='body') {
document.getElementsByTagName('textarea')[0].value='';
}
}
//-->
</script>
</head>
<body onmousemove="elemId(event)">
<form action="#">
<div>
<textarea id="foo" cols="30" rows="5"></textarea>
<input id="blah" type="text"/>
<select id="picker">
<option>selection</option>
<option>Tom</option>
<option>****</option>
<option>Harry</option>
</select>
</div>
</form>
<div id="stuff">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Proin massa. Nam vehicula.
Morbi velit nisi, mollis id, ultrices luctus, adipiscing sit amet, lectus. Nunc rhoncus
nisl ac enim. Maecenas vestibulum dolor ut velit.
</div>
</body>
</html>
coothead
Bookmarks