Jump to content

automatic text changer


brown2005

Recommended Posts

ok html...

<form>
<input type='text' name='text' onkeyup="updateSpan(this.value);>
<input type='text' name='text_color'>
</form>
<span id="text"></text>

and js in the head section

function updateSpan(val)
{
document.getElementById('text').innerHTML = val;
}

try that...
Might seem messy without a function, but it's easy to run as an example:
[code]

<input type='text' id='text' name='text' onkeyup="document.getElementById('text_result').innerHTML = document.getElementById('text').value;">

<input type='text' id='text_color' name='text_color' onkeyup="document.getElementById('text_result').style.backgroundColor = document.getElementById('text_color').value;">

<span id="text_result" style="background-color: white"></span>

[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.