Answers for "jquery dropdown"

3

how to get the value of dropdown in jquery

BY LOVE
$('#ddlName option:selected').val();
Posted by: Guest on May-08-2020
0

set dropdown in jquery

$('select[name^="salesrep"] option[value="Bruce Jones"]').attr("selected","selected");
Posted by: Guest on August-26-2020
0

jquery dropdown select

$('select>option:eq(3)').prop('selected', true);
Posted by: Guest on December-13-2020
0

set dropdown in jquery

$('select[name^="salesrep"] option:selected').attr("selected",null);
Posted by: Guest on August-26-2020
0

dropdown menu jquery

<!DOCTYPE html>
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h2>Dropdown Example</h2>
  <p>The data-toggle="dropdown" attribute is used to open the dropdown menu.</p>
  <div class="dropdown">
    <button class="btn btn-primary dropdown-toggle" id="menu1" type="button" data-toggle="dropdown">Dropdown Example
    <span class="caret"></span></button>
    <ul class="dropdown-menu" role="menu" aria-labelledby="menu1">
      <li role="presentation"><a role="menuitem" tabindex="-1" href="#">HTML</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="#">CSS</a></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="#">JavaScript</a></li>
      <li role="presentation" class="divider"></li>
      <li role="presentation"><a role="menuitem" tabindex="-1" href="#">About Us</a></li>    
    </ul>
  </div>
</div>

</body>
</html>
Posted by: Guest on March-11-2021
0

jquery select dropdown

$('#mySelectElement option')[0].selected = true;
Posted by: Guest on May-06-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language