Back
What are the ways to get and render an input value using jQuery?
Here is one:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.3.min.js" ></script><script type="text/javascript"> $(document).ready(function(){ $("#txt_name").keyup(function(){ alert($(this).val()); }); })</script><input type="text" id="txt_name" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.3.min.js" ></script>
<script type="text/javascript">
$(document).ready(function(){
$("#txt_name").keyup(function(){
alert($(this).val());
});
})
</script>
<input type="text" id="txt_name" />
Try using the code given below:
//Getvar bla = $('#txt_name').val();//Set$('#txt_name').val(bla);
//Get
var bla = $('#txt_name').val();
//Set
$('#txt_name').val(bla);
31k questions
32.8k answers
501 comments
693 users