jQuery获取隐藏文本域
[html] view plaincopyprint?
//jquery获取隐藏域
<style type="text/css">
div{
width:150px;
height:150px;
border:#0F9 solid 1px;
float:left}
</style>
<script type="text/javascript" language="javascript" src="../jquery-1.7.1.min.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function(){
$("#btn2").click(function(){
$("div:hidden").show().css("background","blue");
});
//获取表单隐藏域
$("#btn3").click(function(){
<!----------第一种方法----------->
$("input:hidden").each(function (i){
//dom方法
//alert(this.value);
alert($(this).val());
});
<!------------第二种方法------->
$("input:hidden").each(function(index,s){
//alert(s.value);
alert($(s).val());
})
<!----------第三种方法-------------->
var input=$("input");
$.each(input,function(index,a){
alert(a.value);
});
});
});
</script>
</head>
<body>
<div id="one">id=one</div>
<div id="two">id=two</div>
<div id="three">id=three<span>我是sppan</span></div>
<div style="display:none">adcsac</div>
<input type="hidden" value="hidden_1">
<input type="hidden" value="hidden_2">
<input type="hidden" value="hidden_3">
<input type="hidden" value="hidden_4">
<div id="four" style="clear:both">
<input type="button" value="清空样式" id="btn0">
<input type="button" value="显示所有可见性div" id="btn1">
<input type="button" value="选取隐藏div" id="btn2">
<input type="button" value="选取表单隐藏域" id="btn3">
<input type="button" value="清空样式" id="btn4">
</div>
jQuery获取隐藏文本域的更多相关文章
- jquery获取一组文本框的值
$("#btn5").click(function() { var str="";$("[name='checkbox'][checked]& ...
- jquery 文本域光标操作(选、添、删、取)
一.JQuery扩展 ; (function ($) { /* * 文本域光标操作(选.添.删.取)的jQuery扩展 http://www.cnblogs.com/phpyangbo/p/55286 ...
- JS-007-富文本域操作
在日常 web 编写过程中,富文本域几乎成为了一个网站不可页面元素,同时,其也有着各种各样的实现方式,网络上也存在着各种各样的集成插件可供引用.此文以 js 获取.修改 163 邮箱写邮件时的邮件内容 ...
- jquery获取input输入框中的值
如何用javascript获取input输入框中的值,js/jq通过name.id.class获取input输入框中的value 先准备一段 HTML <input type="tex ...
- js与jquery获取input输入框中的值
如何用javascript获取input输入框中的值,js/jq通过name.id.class获取input输入框中的value 先准备一段 HTML 一.jquery获取input文本框中的值 通过 ...
- jQuery获取表格隐藏域与ajax请求数据结合显示详情
0.表格样式
- [SoapUI]怎样获取隐藏元素的文本内容Get text of hidden element
隐藏元素无法通过gettext()获取其文本内容,须用javascript来获取 String actualDataPointName = (String) ((JavascriptExecutor) ...
- 文本域光标操作(选、添、删、取)的jQuery扩展
; (function ($) { /* * 文本域光标操作(选.添.删.取)的jQuery扩展 @Mr.Think http://mrthink.net/text-field-jquery-exte ...
- jQuery使用ajax跨域请求获取数据
jQuery使用ajax跨域请求获取数据 跨域是我在日常面试中经常会问到的问题,这词在前端界出现的频率不低,主要原因还是由于安全限制(同源策略, 即JavaScript或Cookie只能访问同域下的 ...
随机推荐
- Spring中Bean的作用域
1.在Spring的早期版本中,仅有两个作用域:singleton和prototype,前者表示Bean以单例的方式存在:后者表示每次从容器中调用Bean时,都会返回一个新的实例 2.Spring 2 ...
- 配置webdriver环境
安装环境pip install selenium,提示 Could not find a version that satisfies the requirement selenium (from v ...
- Thinking in Java——笔记(17)
Containers in Depth Full container taxonomy You can usually ignore any class that begins with " ...
- node静态资源管理变迁之路
使用express自带的,express.static,如:app.use(express.static('hehe')),就可以用localhost/hua.png,访问项目根目录下,hehe文件夹 ...
- android必须要进行为不同分辨率设备切图
以分辨率为1920×1080的android设备为例.在项目中加载资源的位置为xxhdpi文件夹: 例如将图片放入mdpi文件夹中就会出现,图片的横纵尺寸分别乘3被的后果,因为它认为在这个文件夹中是低 ...
- http之Session&Cookie
百度了一波session与Cookie,我发现这东西远比我想象中更复杂(可能是因为我不明白底层的运行原理).网上也是一堆的关于Session与Cookie区别/联系的文章,然而,我看完了还是一脸懵逼的 ...
- mysql关于排序值的问题
- Centos6 换源
#主要是为了提高安装速度以及epel中自带源众多木有的软件. #Author wood_man #2016.06.01 v 2.0 1. 测试环境 VMware 10.0 CentOS rele ...
- phongap、APICloud、ionic等app开发平台你都知道吗?
大众创业热,很多人都想在互联网大展拳脚,然而大部分人却是非技术背景.针对这个行业痛点,现在国内外涌现出众多APP开发工具,开发者只要有相关的HTML5.CSS和JavaScript知识,便可以轻松快速 ...
- VS工程添加资源文件
1. 添加资源文件: 2. 资源文件内写相应代码: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006 ...