<fieldset>
<legend>Search for the product:</legend>
<div class="control-group">
<label for="manufacturer" class="control-label" style="float:left; margin-right: 25px;font-size: 16px;font-weight: bold;">Manufacturer:</label>
<div class="controls">
<select id="manufacturer" style="color: black;">
<option>ASUS</option>
<option>HP</option>
<option>Lenovo</option>
<option>Acer</option>
<option>Packard Bell</option>
</select>
</div>
</div>
</fieldset>
<input type="submit" class="btn btn-large btn-success" value="Search" id="searchBtn">
<script>
val manufacturer;
$('#searchBtn').click(function(){
manufacturer = $('#manufacturer').children(':selected').text();
console.log(manufacturer);
});
</script>
I am trying to get the text of the selected item from the select list, but I do not get anything as a result...
Does anyone have an idea what is wrong?

New Topic/Question
Reply



MultiQuote


|