HTML 获取select标签内option对应得值

示例代码:

<h3>视频标题:
<select id="l_id">
{% for item in ress %}
<option value="{{ item.id }}" >{{ item.leibie }}</option>
{% endfor %}
</select></h3>
 
 
script中获取选中得值
var type_id = $("#l_id option:selected").val()
 
posted @ 2019-05-05 21:30  smileOHH  阅读(5333)  评论(0)    收藏  举报