zoukankan      html  css  js  c++  java
  • JQuery操作select中的option

    html页面代码例如以下:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
       <title></title>
       <style type="text/css">
          * { margin:0; padding:0; }
          div.centent {
                       float:left;
                       text-align: center;
                       margin: 10px;
          }
          span {
                 display:block;
                 margin:2px 2px;
                 padding:4px 10px; 
                 background:#898989;
                 cursor:pointer;
                 font-size:12px;
                 color:white;
          }
       </style>
       <!--  引入jQuery -->
       <script src="../jquery/jquery-1.3.1.js" type="text/javascript"></script>
       <script type="text/javascript">
          $(function(){
                 //移到右边
                 $('#add').click(function() {
                        //获取选中的选项,删除并追加给对方
                        $('#select1 option:selected').appendTo('#select2');
           

  • 相关阅读:
    keepass口令管理实践
    openssl实践
    Nmap
    SSH
    Wireshark 实践
    网站设计
    python database
    python gui
    Excel数据统计与分析
    2020-2021学期20202401金丁《网络空间安全专业导论》第十三周自学总结
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/9991281.html
Copyright © 2011-2022 走看看