Maybe noobie question about the keyup function, if the document is ready the div with id "testdiv" is empty that should not be. I want the testdiv empty if you really keyup. I have made a tiny script like this:
<script>
$(document).ready(function(){
$('#test:input').keyup(function () {
$('#testdiv').empty();
}).keyup();
});
</script>
<input type="textfield" id="test" value="test123"/>
<div id="testdiv">Test</div>
Do I have to bind it? Sorry for this beginner question.
Regards,
Frank
This says "bind a keyup handler, then immediately trigger it". The second
keyup
call triggers the handler. If you don't want it fired immediately, remove it: