Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- How to set new content beside input field?


ZakAltF4 - 5:10 pm on Jan 24, 2012 (gmt 0)


I am not sure what you are tying, but if I understand correctly, could you not do something like this?



<head>
< INCLUDE FOR JQUERY LIBRARY >


<script>
function handleInput(){
var my_txt;
my_txt = document.getElementById('TxtIn').value;
document.getElementById('label').innerHTML = my_txt;
}
</script>


</head>

<body>
<textarea required="" onchange="handleInput();" onkeyup="handleInput(); " tabindex="6" cols="30" rows="15" class="" name="TxtIn" id="TxtIn"></textarea> <span id="label"></span>
</body>




You can do nearly anything with SPAN label at this point ...

append:

$('#label').append('<span style="....." .... ');

show/hide:

$('#label').fadeIn('fast');

replace html contents of

$("#label).html('');

change CSS ...

$("#label).css('backgroundColor','#ffffff');


pretty powerful stuff


-- Zak


Thread source:: http://www.webmasterworld.com/javascript/4409631.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com