【笔记】获取下拉列表选中项的值 发表于 2022-07-21 更新于 2023-09-23 阅读次数: 前言获取下拉列表选中项的值 准备工作1234<select id="select"> <option value="值1" selected>内容1</option> <option value="值2">内容1</option></select> Javascript12345678// 获取选中项的索引let index = document.getElementById("select").selectedIndex;// 根据索引获取选中项对象let dom = document.getElementById("select").options[index];// 根据对象获取值dom.value;// 根据获取内容dom.text; jQuery1$("#select option:selected").val() 完成参考文献CSDN——@进行中