zoukankan      html  css  js  c++  java
  • [原创]用JS给DropDownList添加新项!



    <script language="javascript">
            
    function addItem()
            {
             
    if (document.all("v").value==""return;
             
    var tOption = document.createElement("Option");
             tOption.text
    =document.all("v").value;
             tOption.value
    =document.all("DDL1").options.length+1;
             document.all(
    "DDL1").add(oOption);



            }
            
            
    </script>

        <DIV style="BORDER-RIGHT: 1px dotted; BORDER-TOP: 1px dotted; Z-INDEX: 103; LEFT: 304px; BORDER-LEFT: 1px dotted; WIDTH: 304px; BORDER-BOTTOM: 1px dotted; POSITION: absolute; TOP: 288px; HEIGHT: 160px; BACKGROUND-COLOR: ghostwhite"
                    ms_positioning
    ="GridLayout"><INPUT onclick="addItem();" style="Z-INDEX: 101; LEFT: 136px; WIDTH: 99px; POSITION: absolute; TOP: 56px; HEIGHT: 22px"
                        type
    ="button" value="添加新项目" id="addnew">
                    
    <asp:DropDownList id="DDL1" style="Z-INDEX: 102; LEFT: 32px; POSITION: absolute; TOP: 96px" runat="server"
                        Width
    ="96px">
                        
    <asp:ListItem Value="0">北京</asp:ListItem>
                        
    <asp:ListItem Value="1">天津</asp:ListItem>
                        
    <asp:ListItem Value="2">上海</asp:ListItem>
                    
    </asp:DropDownList><INPUT id="v" style="Z-INDEX: 103; LEFT: 32px; WIDTH: 96px; POSITION: absolute; TOP: 56px; HEIGHT: 22px"
                        type
    ="text" size="10"></DIV>
  • 相关阅读:
    Spring AOP capabilities and goals
    java Design Patterns
    CDI Features
    connector for python实验
    spring ref &history&design philosophy
    LDAP & Implementation
    RESTful Levels & HATEOAS
    运维管理利器系列--ipmitool
    CentOS8.2同步阿里云Zabbix镜像到本地,本地搭建Zabbix仓库
    CentOS8.2同步阿里云Ceph镜像到本地,本地搭建ceph仓库
  • 原文地址:https://www.cnblogs.com/goody9807/p/186602.html
Copyright © 2011-2022 走看看