Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

jQuery .val() method

0 votes
3 views
added Feb 9 in jQuery by LC Marshal Lieutenant (12,590 points)
edited 8 hours ago by LC Marshal

Get value for selected option

var property_type = $('#property_type option:selected').val();

 

1 Response

0 votes
responded Apr 2 by LC Marshal Lieutenant (12,590 points)

Add value to button upon click

<p>Name: <input type="text" name="user"></p>
$("button").click(function(){
    $("input:text").val("Get this value upon click);
});
lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...