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
sure. textBox = document.getElementById("textbox"); textBox.onfocus = callMeOnFocus; It's actually even easier than that in this case you could do this [code] <html> <head> <title>Adding Properties Dynamicly</title> <!-- Import the classes --> <script type="text/javascript"> function pageInit() { var textBox = document.getElementById("textbox"); textBox.onfocus = function () { var changeText = document.getElementById("changeOnFocus"); changeText.innerHTML = this.value; } } </script> </head> <body onload="pageInit();"> <div id="changeOnFocus">text</div> <input type="text" id="textbox"/> </body> </html> [/code] In this. because you are trying to get the value of the element that you're making the focus handler for, the "this" statement refers to itself [img]http://www.bitdamaged.com/graphics/bitsig.gif[/img] .:[ Never resist a perfect moment ]:. [small](Edited by [internallink=51]bitdamaged[/internallink] on 09-24-2005 03:53)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »