如何制作<select>的第一个选项用 jQuery 选择 [英] How to make the first option of <select> selected with jQuery
本文介绍了如何制作<select>的第一个选项用 jQuery 选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用 jQuery 选择第一个选项?
How do I make the first option of selected with jQuery?
<select id="target">
<option value="1">...</option>
<option value="2">...</option>
</select>
推荐答案
$("#target").val($("#target option:first").val());
这篇关于如何制作<select>的第一个选项用 jQuery 选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文