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

jQuery .val() method

0 votes
added Feb 9 in jQuery by LC Marshal Lieutenant (14,830 points)
edited Aug 16 by LC Marshal

Get value for selected option

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


2 Responses

0 votes
responded Apr 2 by LC Marshal Lieutenant (14,830 points)

Add value to button upon click

<p>Name: <input type="text" name="user"></p>
    $("input:text").val("Get this value upon click);
0 votes
responded Oct 31 by LC Marshal Lieutenant (14,830 points)
// if value is empty, do this, else do that
$requestCommentTextarea.on("input", function() {
    if ($requestCommentTextarea.val() !== "") {
      $requestCommentSubmitButton.prop("disabled", false);
    } else {
      $requestCommentSubmitButton.prop("disabled", true);
}); - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.