zoukankan      html  css  js  c++  java
  • javascript动态创建控件的最简洁方法:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
      <TITLE> New Document </TITLE>
      <META NAME="Generator" CONTENT="EditPlus">
      <META NAME="Author" CONTENT="">
      <META NAME="Keywords" CONTENT="">
      <META NAME="Description" CONTENT="">
      <style type="text/css" >
    a.god
    {
      200px;
      height:30px;
      font-family:'宋体',Arial;
      font-size:14px;
      text-decoration:none;
      display:block;
      padding:10px,25px,5px,25px;
      color:#000;
    }
    a.god:hover
    {
      color:#fff;
      background-color:#339;
    }
      </style>
      <****** type="text/javascript" >
    function AddingControls()
    {
      var strHtml = "<a class='god' href='http://www.baidu.com' >XK-000-2010-02-06-01</a>";
      strHtml += "<a class='god' href='http://www.baidu.com' >XK-000-2010-02-06-01</a>";
      strHtml += "<a class='god' href='http://www.baidu.com' >XK-000-2010-02-06-01</a>";
      strHtml += "<a class='god' href='http://www.baidu.com' >XK-000-2010-02-06-01</a>";
      document.getElementById("panel1") = strHtml;
    }
    function doing()
    {
      alert("god!");
      return false;
    }
      </script>
    </HEAD>

    <BODY>
    <div id="panel1" >
    </div>
    <input type="button" value="增加控件"   >
    <input type="button" value="关闭" >
    </BODY>
    </HTML>

  • 相关阅读:
    superset可视化不同算法的点击率
    flume通过avro对接(汇总数据)
    Flume同时输出数据到HDFS和kafka
    剑指offer题目系列二
    剑指offer题目系列一
    Servlet生命周期与线程安全
    Servlet初始化及处理HTTP请求
    Servlet及相关类和接口
    web.xml配置文件详解
    递归与斐波那契数列
  • 原文地址:https://www.cnblogs.com/binaryworms/p/1689156.html
Copyright © 2011-2022 走看看