: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的区别分析的更多相关文章

  1. jquery中attr和prop的区别分析

    这篇文章主要介绍了jquery中attr和prop的区别分析的相关资料,需要的朋友可以参考下 在高版本的jquery引入prop方法后,什么时候该用prop?什么时候用attr?它们两个之间有什么区别 ...

  2. 【jQuery】【转】jQuery中的trigger和triggerHandler区别

    trigger(event, [data]) 在每一个匹配的元素上触发某类事件. 这个函数也会导致浏览器同名的默认行为的执行.比如,如果用trigger()触发一个'submit',则同样会导致浏览器 ...

  3. jquery中attr和prop的区别、 什么时候用 attr 什么时候用 prop (转自 芈老头 )

    jquery中attr和prop的区别. 什么时候用 attr 什么时候用 prop   在高版本的jquery引入prop方法后,什么时候该用prop?什么时候用attr?它们两个之间有什么区别?这 ...

  4. jQuery中.attr()和.prop()的区别

    之前学习jQuery的时候,学习到了两种取得标签的属性值的方法:一种是elemJobj.attr(),另一种是elemJobj.prop().而在学习JS的时候,只有一种方法elemObj.getAt ...

  5. jquery中attr和prop的区别(转)

    在网络上看到这样一篇关于jquery中attr和prop的区别文章,觉得不错,所以转载了. 在jQuery 1.6中,.attr()方法查询那些没有设置的属性,则会返回一个undefined.如果你要 ...

  6. jquery中prop和attr的区别

    jquery中prop和attr的区别 prop: prop(name|properties|key,value|fn) **概述** 获取在匹配的元素集中的第一个元素的属性值. 随着一些内置属性的D ...

  7. Jquery学习笔记(6)--jquery中attr和prop的区别【精辟】

    jquery中attr和prop的区别 在高版本的jquery引入prop方法后,什么时候该用prop?什么时候用attr?它们两个之间有什么区别?这些问题就出现了. 关于它们两个的区别,网上的答案很 ...

  8. Java中Comparable和Comparator接口区别分析

    Java中Comparable和Comparator接口区别分析 来源:码农网 | 时间:2015-03-16 10:25:20 | 阅读数:8902 [导读] 本文要来详细分析一下Java中Comp ...

  9. JQuery中的html(),text(),val()区别

    jQuery中.html()用为读取和修改元素的HTML标签,.text()用来读取或修改元素的纯文本内容,.val()用来读取或修改表单元素的value值. 1.HTML html():取得第一个匹 ...

  10. Jquery中的 height(), innerHeight() outerHeight()区别

    jQuery中的 height innerHeight outerHeight区别 标准浏览器下: height:高度 innerHeight:高度+补白 outerHeight:高度+补白+边框,参 ...

随机推荐

  1. 使用VS软件打开网站在浏览器浏览的方法

    1.用VS软件打开网站之后,先检查网站是否使用IIS Express开发 2.若不是,则切换成使用IIS Express开发 3.检查项目使用的托管管道模式设置为经典模式了没有 4.最后选择“在浏览器 ...

  2. HDU 2802 F(N) 数论+打表

    题目大意:f[n]-n^3=f[n-2]-(n-1)^3 (n >=3),f[1]=1,f[2]=7,求f[n]. 题目思路:将n^3移到到等式右边化简的到:f[n]=f[n-2]+3n*(n- ...

  3. linux 终端相关

    echo cd ~/桌面 >> .bashrc 将终端默认路径设为桌面 -/.bashrc./etc/bash.bashrc./etc/profile这几个文件.这些文件的的作用时机:/e ...

  4. php array_walk_recursive函数的使用

    <?phpfunction myfunction($value,$key) {echo "The key $key has the value $value<br />&q ...

  5. oracle 基础使用以及sql语句基础

        oracle的安装与卸载 要记住数据库口令,适用于sys.system.sysman/dbsnmp等账户,而scott帐号密码默认为tiger, 以oracle  10g来说,scott账户默 ...

  6. apache-tomcat-7.0.70无法进入Manager管理App项目

    在tomcat文件夹找到conf文件夹中的tomcat-user.xml文件,用记事本打开,在最下面可以看到tomcat默认把用户注释掉了,也就是说打开tomcat主页是进不去管理页面的.方法如下:找 ...

  7. 更方便的函数回调——Lambda

    auto callbackFunc = [&](){ backHome(); }; []符号,表示要开始一个lambda函数: ()符号,里面填写函数的参数: 当想在lambda函数里使用外部 ...

  8. ARP及RARP简介

    1.概念 ARP(Address Resolution Protocol) 地址解析协议 RARP(Reverse Address Resolution Protocol) 反向地址解析协议 2.AR ...

  9. springMVC如何访问静态文件

    在进行Spring MVC的配置时,通常我们会配置一个dispatcher servlet用于处理对应的URL.配置如下:<servlet><servlet-name>mvc- ...

  10. android4.0蓝牙使能的详细解析(转)

    源:http://www.cnblogs.com/xiaochao1234/p/3818193.html 本文详细分析了android4.0 中蓝牙使能的过程,相比较android2.3,4.0中的蓝 ...