<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="JsExerciseTow.WebForm1" %>

<!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 runat="server">
<title></title>
<script type="text/javascript">
window.onload = function () {
var divAppend = document.getElementById("appendBtn");
var obj = document.createElement("Input");
divAppend.appendChild(obj);
obj.type = "button";
obj.value = "我是进加上的Input"; if (window.addEventListener) {
//其它浏览器的事件代码: Mozilla, Netscape, Firefox
//添加的事件的顺序即执行顺序 //注意用 addEventListener 添加带on的事件,不用加on
obj.addEventListener('focus', add, false);
}
else {
//IE 的事件代码 在原先事件上添加 add 方法
obj.attachEvent('onfocus', add);
} }
function add() {
alert("我是追加按钮的事件");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="appendBtn"> </div>
</form>
</body>
</html>

最新文章

  1. Delphi 关键字详解[整理于 &quot;橙子&quot; 的帖子]
  2. gulp任务
  3. Python-操作Memcache、Redis、RabbitMQ、
  4. 九幽2015年Q3 WP市场份额细分报告
  5. stretchableImageWithLeftCapWidth 的使用方法
  6. JQuery 表格 隔行换色 和鼠标滑过的样式
  7. iOS xcuserdata
  8. [TypeScript] Installing TypeScript and Running the TypeScript Compiler (tsc)
  9. 分享整理的sql脚本
  10. 安装mysql时提示The host &#39;xxx&#39; could not be looked up with resolveip的解决办法
  11. Swift - AppDelegate.swift类中默认方法的介绍
  12. html中滚动栏的样式
  13. 微信应用号开发知识贮备之Webpack实战
  14. Bootstrap中关闭第二个模态框时出现的问题和解决办法
  15. Python3入门基础--str常用方法
  16. Java 中单引号和双引号的区别
  17. 解决镜像无法删除的问题multiple repositories
  18. 【K8S学习笔记】Part1:使用端口转发访问集群内的应用
  19. 解决windows下vim中文乱码
  20. Suggestion: add &#39;tools:replace=&quot;android:value&quot;&#39; to &lt;meta-data&gt; element at AndroidManifest.xml:25:5-27:41 to override.

热门文章

  1. .net core3
  2. cf Perfect Pair
  3. C++中实现回调机制的几种方式(一共三种方法,另加三种)
  4. QT下实现对Linux Shell调用的几种方法
  5. centos无线网卡设置
  6. [深入JUnit] 为什么别测试private函数
  7. JVM运行时内存结构
  8. J2EE学习路线
  9. JAVA并发实现二(线程中止)
  10. 原生javascript 获得css样式有几种方法?