document.all.item作用
1、document.all.myCheckBox和 document.all.item通过控件的名字定位控件,item()中是控件的名字
例如:
<input type="checkbox" name="myCheckBox">
可以用
document.all.myCheckBox得到这个控件,也可以写成document.all.item("myCheckBox")
用item的好处是,
1.如果你的控件的name是数字,比如<br>
<input type="checkbox" name="123456789">
,使用document.all.123456789会报错,用document.all.item("123456789")可以正确得到。
2.如果你的控件名字存在一个变量中,你必须这样写
var name = "myCheckBox";
eval("document.all."+name);
同样也可以写成document.all.item(name)
<form name="form1">
<input id="a" name="a" type="text" value="123123213">
</form>
<script language="javascript">
document.write(document.form1.a.value);
document.write("<br>");
document.write(document.all.item("a").value);
</script>
2、一个form同时提交到两个页面的效果,工作的需要,随手记了下来!
<script language="javascript">
function F_submit(){
document.form1.target="_blank";
document.form1.action="1.asp";
document.form1.submit();
document.form1.target="_blank";
document.form1.action="2.asp";
document.form1.submit();
}
</script>
<form name="form1" method="post" action="">
<input type="text" name="textfield">
<input type="button" name="Submit" value="提交" onClick="F_submit()">
</form>
document.all.item作用的更多相关文章
- (predicted == labels).sum().item()作用
⚠️(predicted == labels).sum().item()作用,举个小例子介绍: # -*- coding: utf-8 -*-import torch import numpy as ...
- 详解jquery插件中(function ( $, window, document, undefined )的作用。
1.(function(window,undefined){})(window); Q:(function(window,undefined){})(window);中为什么要将window和unde ...
- 详解jquery插件中;(function ( $, window, document, undefined )的作用
在jquery插件中我们经常看到以下这段代码 1 2 3 ;(function ( $, window, document, undefined ){ //函数体内具体代码 })(jQuery, wi ...
- jquery插件中(function ( $, window, document, undefined )的作用
在jquery插件中我们经常看到以下这段代码 ;(function ( $, window, document, undefined ){ //函数体内具体代码 })(jQuery, window,d ...
- JS的Document属性和方法小结
Document想必大家并不陌生吧,在使用js的过程中会经常遇到它,那么它有哪些属性.哪些方法,在本文将以示例为大家详细介绍下,希望对大家有所帮助 document.title //设置文档标题等价于 ...
- document.readyState等属性,判断页面是否加载完
如何在页面加载完成后再去做某事?什么方法可以判断当前页面加载已完成?document.readyState 判断页面是否加载完成?javascript提供了document.readyState==& ...
- jQuery $(document).ready() 与window.onload的区别
ps:jQuery中$(document).ready()的作用类似于传统JavaScript中的window.onload方法,虽然具有类似的效果,但是它们在触发操作的时间上存在着微妙的差异. 在j ...
- jquery $(document).ready() 与window.onload的异同
Jquery中$(document).ready()的作用类似于传统JavaScript中的window.onload方法,不过与window.onload方法还是有区别的. 1.执行时间 ...
- 转载 jquery $(document).ready() 与window.onload的区别
Jquery中$(document).ready()的作用类似于传统JavaScript中的window.onload方法,不过与window.onload方法还是有区别的. 1.执行时间 windo ...
随机推荐
- Python中的getattr()函数详解
最近看Dive into python第四章自省中提到getattr()函数,作为一个内建函数平时自己没怎么用过所以也不太理解这个函数的一些用法 看了下函数本身的doc getattr(object, ...
- [hdu2196]Computer树的直径
题意:求树中距离每个节点的最大距离. 解题关键:两次dfs,第一次从下向上dp求出每个节点子树中距离其的最大距离和不在经过最大距离上的子节点上的次大距离(后序遍历),第二次从上而下dp求出其从父节点过 ...
- submatrix
given a 2-d matrix with 0 or 1 values largest square of all 1's dynamic programming, dp[i][j] = 1 + ...
- array / matrix subarray/submatrix sum
Maximal Subarray Sum : O(n) scan-and-update dynamic programming, https://en.wikipedia.org/wiki/Maxim ...
- linux命令配置IP详解
在Linux系统中,TCP/IP网络是通过若干个文本文件进行配置的,有时需要编辑这些文件来完成联网工作. vi /etc/sysconfig/network-scripts/ifcfg-eth0 :进 ...
- Al-Qaeda affiliate in&…
By Greg Miller, Updated: Friday, February 1, 4:13 AM New intelligence on al-Qaeda's affiliate in Nor ...
- bootstrap下拉框式标签页
<ul id="myTab" class="nav nav-tabs"> <li class="active"> & ...
- Ubuntu 16 Mysql 安装配置
安装Mysql apt-get update; apt-get install mysql-server apt-get install mysql-client //安装过程中会提示修改密码 ...
- JAVA企业级开发-JavaScript(02)
一.JavaScript介绍 Javascript语言诞生主要是完成页面的数据验证.因此它运行在客户端,需要运行浏览器来解析执行JavaScript代码. 特点: 交互性(它可以做的就是信息的动态交互 ...
- SQL Server 截取两个固定字符之间的字符串(案例)
网上的问题: 参考这篇<函数PARSENAME使用和截取字符串>https://www.cnblogs.com/insus/p/10958452.html 的方法: )='||MO21|T ...