开发者

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

How can I change the unselected item to selected item fro开发者_JAVA百科m dropdown list without using the iterator function in Jquery?


Two notes before the answer.

  1. selected="true" for HTML, selected="selected" for XHTML
  2. Multiple selections need to be enabled on the select

Here is the jQuery "not" selector in action.

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜