OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
This belongs in the DOM form, but the door was locked.
This page's ID:
26710
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Is there anyway to add an event handler in IE and Mozilla/Firefox dynamiclly and also pass it a varable? [code] <html> <head> <title>Adding Properties Dynamicly</title> <!-- Import the classes --> <script type="text/javascript" src="./js4/Employee.js"></script> <script type="text/javascript"> function pageInit() { var textBox = document.getElementById("textbox"); var onFocusAttr = document.createAttribute("onfocus"); onFocusAttr.nodeValue = "callMeOnFocus(textbox)"; textBox.setAttributeNode(onFocusAttr); alert(textBox.getAttribute("onfocus")); } function callMeOnFocus(textBox) { alert("callMeOnFocus in function"); var changeText = document.getElementById("changeOnFocus"); changeText.innerHTML = textBox.value; } </script> </head> <body onload="pageInit();"> <div id="changeOnFocus">text</div> <input type="text" id="textbox" onclick="alert(textBox.value)"/> </body> </html> [/code] thanks, [IMG]http://i9.photobucket.com/albums/a58/Maskkkk/maskkkkaroni.png[/IMG] - AIM: MASKKKK [url=http://nickciske.com/tools/binary.php] 01001101011000010111001101101011011010110110101101101011[/url]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »