zoukankan      html  css  js  c++  java
  • js来回移动多项select的option元素

    Code

    select元素的 .options.length = 0 会清空其下所有option

                      .options.add(new option(optiontext,optionvalue))    增加一个option

                      .options[元素编号].selected == true   判断该option是否被选中

    可以多选的select:

    <select id="..." name="..." size="10" multiple="multiple" ><option value="...">...</option></select>

  • 相关阅读:
    01_垂直居中body中的应用
    C++基础知识易错点总结(2)
    辗转相除求最大公约数
    C++基础知识易错点总结(1)
    类对象的建立方式总结
    LeetCode(131)Palindrome Partitioning
    基本套接字编程(7) -- udp篇
    LeetCode(124) Binary Tree Maximum Path Sum
    LeetCode(115) Distinct Subsequences
    LeetCode(97) Interleaving String
  • 原文地址:https://www.cnblogs.com/abinxm/p/1436842.html
Copyright © 2011-2022 走看看