So I am learning prototype and I have a basic question changing data
in a div with innerHTML. Here is what I am trying to do :
[code]
<html>
<head>
<script src="prototype.js"></script>
<script language="javascript">
function test3()
{
var outPut = $F('userName');
alert( outPut );
('uName').innerHTML = outPut;
}
</script>
</head>
<body>
<input type="text" id="userName" value="Joe Doe"><br/>
<input type="button" value="Test3" onclick="test3();"><br/>
<div id="uName">
What is your username?
</div>
</body>
</html>
[/code]
So I want to change the uName div with the data that comdes from the
userName data. I am not sure how to do this. All the documentation
from http://www.sergiopereira.com/articles/prototype.js.html deals
with alerts and no other return of data.
How can I replace the data "What is your username" with what is
contained within the textbox?
Thanks
-T
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---