Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (20.3k points)

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"  />

1 Answer

0 votes
by (40.7k points)

Try using the code given below:

//Get

var bla = $('#txt_name').val();

//Set

$('#txt_name').val(bla);

Browse Categories

...