繁体   English   中英

如何在不使用Jquery中的迭代器功能的情况下将未选择的项目从下拉列表更改为选定的项目?

[英]How can I change the unselected item to selected item from dropdown list without using the iterator function in Jquery?

如何在不使用Jquery中的迭代器功能的情况下将未选择的项目从下拉列表更改为选定的项目?

答案前有两个音符。

  1. 对于HTML,为“ selected =“ true”,对于XHTML,为selected =” selected“
  2. 需要在选择上启用多个选择

这是运行中的jQuery“ not”选择器。

$("select option:not(:selected)").attr("selected", "true");

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM