<tfoot>
<select>
<option value="222"></option>
<option value="2222">2222</option>
<option value="zaza">zaza</option>
</select>
</tfoot>
I tried that:
$('tfoot select').val('zaza');
$("tfoot select").val("zaza")
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<tfoot>
<select>
<option value="222"></option>
<option value="2222">2222</option>
<option value="zaza">zaza</option>
</select>
</tfoot>
Any idea ? Select = make it selected = trigger the change event
You can use:
$('option[value="222"]')
In general,
$("tag[attr=value]")
will search a tag
with attributte attr
and value value
To select it,
$('option[value="222"]').prop("selected", true);
$(function () {
$("#clientList").children('[value="zaza"]').attr('selected', true);
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<tfoot>
<select id="clientList">
<option value="222">222</option>
<option value="2222">2222</option>
<option value="zaza">zaza</option>
</select>
</tfoot>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With