1.追加html>div标签
2009-03-04 19:45
232 查看
很简单,没有什么要介绍的,直接看代码.
Code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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>jQuery追加<div></title>
<script src="jquery-1.3.2.js"type="text/javascript"></script>
<%--<script src="jquery-1.3.2-vsdoc.js" type="text/javascript"></script>--%>
<script type="text/javascript">
$(document).ready(function() {
$(document.body).click(function() {
$(document.body).append($("<div>"));
var n = $("div").size();
$("span").text("There are " + n + " divs." + "click to add more.");
}).click();
});
</script>
<style type="text/css">
body{ cursor:pointer;}
div{ width:50px; height:30px; margin:5px; float:left; background:blue;}
sapn{ color:Red;}
</style>
</head>
<body>
<form id="form1" runat="server">
<span></span>
<div></div>
</form>
</body>
</html>
源代码 " style="COLOR: #ffffff" href="http://files.cnblogs.com/dreamsky/jQuery200901.rar">/Files/dreamsky/jQuery200901.rar
Code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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>jQuery追加<div></title>
<script src="jquery-1.3.2.js"type="text/javascript"></script>
<%--<script src="jquery-1.3.2-vsdoc.js" type="text/javascript"></script>--%>
<script type="text/javascript">
$(document).ready(function() {
$(document.body).click(function() {
$(document.body).append($("<div>"));
var n = $("div").size();
$("span").text("There are " + n + " divs." + "click to add more.");
}).click();
});
</script>
<style type="text/css">
body{ cursor:pointer;}
div{ width:50px; height:30px; margin:5px; float:left; background:blue;}
sapn{ color:Red;}
</style>
</head>
<body>
<form id="form1" runat="server">
<span></span>
<div></div>
</form>
</body>
</html>
源代码 " style="COLOR: #ffffff" href="http://files.cnblogs.com/dreamsky/jQuery200901.rar">/Files/dreamsky/jQuery200901.rar
相关文章推荐
- [html] div标签
- HTML中<div>标签的一个简单的使用和介绍
- div+css布局中选择使用html标签的方法
- HTML <div> 标签的 align 属性
- html标签overflow属性和javascript实现div标签滚动问题
- HTML中Div、span、label标签的区别
- jquery的html()方法,不是输出所有的html标签,比如div标签,明明有,使用html()方法中得到的html代码中,就是没有
- html中的div标签的含义
- HTML基础---认识标签(ul,ol,div,table,caption,dl,dt)
- ajax请求到后台数据,前台不用拼接字符串append追加HTML标签,使用空模板一样显示到页面
- HTML中为何P标签内不可包含DIV标签?
- html中的div标签和p标签的语义区别
- html中的div标签的含义和应用
- 真正让HTML标签、DIV、SPAN拥有onfocus和onblur,聚焦和失焦
- AHK中实用的HTML标签对应DIV匹配函数
- HTML中Div、span、label标签的区别
- html中DIV+CSS与TABLE布局方式的区别及HTML5新加入的结构标签(转)
- HTML中的div标签
- HTML中为何P标签内不可包含DIV标签?
- html div标签的简单应用