javascript - Keyup function is not transferring data in the lower div -
keeping simple , short, code , want have text content text input field shown in div(showcontent)..although no jquery error flagging in firebug..but still not showing content in lower div, let me know doing wrong ?
also let me know correct function type of functionality if keyup
not appropriate handling this?
<form> <input type="text" name="usertext" placeholder="enter text" id="usertext" /> </form> <div id="showcontent"></div> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> jquery(document).ready(function(){ jquery('#usertext').keyup(function(){ var mytext = jquery('#usertext').text(); jquery('#showcontent').html(mytext); }); }); </script>
i tried jquery('#usertext').on('keyup',function(){...});
no :(
there proble in reading text input box
use
var mytext = jquery('#usertext').val();
Comments
Post a Comment