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
4 views
added Feb 9 in jQuery by LC Marshal Lieutenant (13,870 points)
edited Aug 16 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 (13,870 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.
...