I cant figure it out why it doesn’t work on chrome only whereas it working on firefox and ie.
HTML CODE:
<select name="goyale" id="goyale">
<option value="0">Select</option>
<option value="1">Fish</option>
<option value="2">Chicken</option>
<option value="3">Meat</option>
</select>
jQuery CODE:
$(document).ready(function () {
$("select#goyale option[value='<?php echo $row['goyale']; ?>']").attr("selected", "selected");
});
Whenever i inspect element on chrome, it displays the option as <option value="3" selected="selected">Meat</option> but the option doesn’t appear selected on naked eye display.
Thanks.
The problem lies within jQuery 1.6, once i update to jQuery 1.7, the problem gone and the select function is working as intended. Thank you and i have should have updated to latest version before posting here.