Home > Web Front-end > JS Tutorial > What are the methods for accessing node objects in JavaScript and how to use them_javascript tips

What are the methods for accessing node objects in JavaScript and how to use them_javascript tips

WBOY
Release: 2016-05-16 17:21:37
Original
1098 people have browsed it

JavaScript中访问节点对象的方法有哪些?

复制代码 代码如下:

var obj = document.getElementById('fdafda');

var obj = document.f1;
obj.method="post";
obj.action='Bb';

var obj = document.f1.userName;

var obj = document.forms[0].userName;

var obj = document.forms[0].elements[0];

var obj = document.f1.elements[0];
var obj = document.forms["f1"].elements["userName"];
var obj = document.forms[0].like;
for(var i=0;i{
var aa = obj[i];
if(aa.checked)
{
alert();
}
}



















Related labels:
js
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template