jquery中:input和input的区别分析
:input表示选择表单中的input,select,textarea,button元素,input仅仅选择input元素。
<html>
<head>
<style>
.focus{
background-color: blue
}
</style>
</head>
<body>
<script type="text/javascript" src="scripts/jquery.1.6.1.min.js"></script>
<script type="text/javascript">
$(function(){
$(":input").focus(function(){
$(this).addClass("focus");
}).blur(function(){
$(this).removeClass("focus");
});
})
</script>
<form action="" method="post" id="regForm">
<fieldset>
<legend>Personal Info</legend>
<div>
<label for="username">Name:</label>
<input id="username" type="text" />
</div>
<div>
<label for="pass">Password:</label>
<input id="pass" type="password" />
</div>
<div>
<label for="msg">Detail Information:</label>
<textarea id="msg" rows="2" cols="20"></textarea>
</div>
<div>
<select name="single">
<option>Single</option>
<option>Single2</option>
</select>
</div>
<div>
<select name="multiple" multiple="multiple">
<option selected="selected">Multiple</option>
<option>Multiple2</option>
<option selected="selected">Multiple3</option>
</select>
</div>
</fieldset>
</body>
</html>

http://www.jb51.net/article/27688.htm
jquery中:input和input的区别分析的更多相关文章
- jquery中attr和prop的区别分析
这篇文章主要介绍了jquery中attr和prop的区别分析的相关资料,需要的朋友可以参考下 在高版本的jquery引入prop方法后,什么时候该用prop?什么时候用attr?它们两个之间有什么区别 ...
- 【jQuery】【转】jQuery中的trigger和triggerHandler区别
trigger(event, [data]) 在每一个匹配的元素上触发某类事件. 这个函数也会导致浏览器同名的默认行为的执行.比如,如果用trigger()触发一个'submit',则同样会导致浏览器 ...
- jquery中attr和prop的区别、 什么时候用 attr 什么时候用 prop (转自 芈老头 )
jquery中attr和prop的区别. 什么时候用 attr 什么时候用 prop 在高版本的jquery引入prop方法后,什么时候该用prop?什么时候用attr?它们两个之间有什么区别?这 ...
- jQuery中.attr()和.prop()的区别
之前学习jQuery的时候,学习到了两种取得标签的属性值的方法:一种是elemJobj.attr(),另一种是elemJobj.prop().而在学习JS的时候,只有一种方法elemObj.getAt ...
- jquery中attr和prop的区别(转)
在网络上看到这样一篇关于jquery中attr和prop的区别文章,觉得不错,所以转载了. 在jQuery 1.6中,.attr()方法查询那些没有设置的属性,则会返回一个undefined.如果你要 ...
- jquery中prop和attr的区别
jquery中prop和attr的区别 prop: prop(name|properties|key,value|fn) **概述** 获取在匹配的元素集中的第一个元素的属性值. 随着一些内置属性的D ...
- Jquery学习笔记(6)--jquery中attr和prop的区别【精辟】
jquery中attr和prop的区别 在高版本的jquery引入prop方法后,什么时候该用prop?什么时候用attr?它们两个之间有什么区别?这些问题就出现了. 关于它们两个的区别,网上的答案很 ...
- Java中Comparable和Comparator接口区别分析
Java中Comparable和Comparator接口区别分析 来源:码农网 | 时间:2015-03-16 10:25:20 | 阅读数:8902 [导读] 本文要来详细分析一下Java中Comp ...
- JQuery中的html(),text(),val()区别
jQuery中.html()用为读取和修改元素的HTML标签,.text()用来读取或修改元素的纯文本内容,.val()用来读取或修改表单元素的value值. 1.HTML html():取得第一个匹 ...
- Jquery中的 height(), innerHeight() outerHeight()区别
jQuery中的 height innerHeight outerHeight区别 标准浏览器下: height:高度 innerHeight:高度+补白 outerHeight:高度+补白+边框,参 ...
随机推荐
- 【dp 背包变形】 poj 1837
#include <cstdio> #include <memory.h> #include<iostream> using namespace std; ][]; ...
- Timewarp 一种生成当中帧技术,异步时间扭曲(Asynchronous Timewarp)
翻译: https://www.oculus.com/blog/asynchronous-timewarp/ 异步时间扭曲(Asynchronous Timewarp 时间扭曲,即调整时长) 关 ...
- ACE_Time_Value
头文件“Time_Value.h” 为了兼容各个平台的时间特性,ACE Reactor框架提供了ACE_Time_Value类.ACE_Time_Value的关键方法见下图3.2和表3.2.3.3: ...
- mysql Group By
1.概述 “Group By”从字面意义上理解就是根据“By”指定的规则对数据进行分组,所谓的分组就是将一个“数据集”划分成若干个“小区域”,然后针对若干个“小区域”进行数据处理. 2.原始表 3.简 ...
- 在WIN7/8下把XP装入VHD (下)
系统平台:win8.1,安装在C盘 操作目的:在win8.1下装一个VHD XP. 操作方法: 在http://www.cnblogs.com/mahocon/p/5212914.html里贴了一个 ...
- hdu 1535 Invitation Cards(SPFA)
Invitation Cards Time Limit : 10000/5000ms (Java/Other) Memory Limit : 65536/65536K (Java/Other) T ...
- ZOJ 2866 Overstaffed Company
树状数组 #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> ...
- 改写BlogEngine.NET头像上传实现方式(使用baidu.flash.avatarMaker)
baidu.flash.avatarMaker 需要资源文件和javascript类库: 1 2 3 4 5 6 7 需要应用的script library: <scriptsrc=" ...
- Servlet程序开发-Helloworld
D:\Workspace\WEB-INF\classes下新建HelloServlet.java文件: package org.lxh.servletdemo ; import java.io.* ; ...
- P8 Visible Lattice Points
P8 Visible Lattice Points Time Limit:1000ms, Memory Limit:65536KB Description A lattice point (x ...