DOM and Script event question...

admin

Administrator
Staff member
I found this information about accessing a tags script properties ( <!-- m --><a class="postlink" href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/properties/event.asp">http://msdn.microsoft.com/library/defau ... /event.asp</a><!-- m --> ). And here is a script I wrote to work with it:
<html>
<head>
<title>Untitled</title>
<script language="javascript">
function init(){
document.myForm.mySelect.event = doThis();
document.myForm.myText.script.event[onClick] = doThis();
}
function doThis(){
alert('doThis');
}
</script>
</head>
<body onLoad="init();">
<form name="myForm">
<select name="mySelect" onChange="alert('hi');">
<option>Hello</option>
<option>World</option>
</select>
<br><br>
<input name="myText">
</form>
</body>
</html>

Does this look right? I wanna change the onChange event from saying 'hi' in an alert to saying 'dothis'.

Jason
 
Back
Top