Home  >  Article  >  Web Front-end  >  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
WBOYOriginal
2016-05-16 17:21:371054browse

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();
}
}



















Statement:
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