jquery dropdown select
$('select>option:eq(3)').prop('selected', true);
jquery dropdown select
$('select>option:eq(3)').prop('selected', true);
html create drop down list
<html>
<head>
<title>Selection Inputs</title>
</head>
<body>
<form>
<label for="selector"> <!-- Can add label if want -->
<p>A "select" element allows users to input from a selection:</p>
<select id="selector"> <!-- Use "select" to create object -->
<option>Option 1</option> <!-- Add all applicable options -->
<option>Option 2</option>
<option selected>Option 3</option> <!-- add selected to change default from first option -->
<optgroup label="Group"> <!-- To create nested options for categories use "optgroup" -->
<option>Option 4</option>
<option>Option 5</option>
</select>
</label>
</form>
</body>
</html>
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>
jquery dropdown select
$("#element-id").val('the value of the option');
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us