请教各位了,多谢!这是html的代码:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script type="text/javascript" src="example2.js"></script>
</HEAD> <BODY>
<p>
There are three different types of element in this body:
</p>
<ul>
<li>
paragraph
</li>
<li>
unorder list
</li>
<li>
list item
</li>
</ul>
<p>
There are two children of html
</p>
<ul>
<li>
head
</li>
<li>
body
</li>
</ul>
</BODY>
</HTML>这是js文件代码(文件名为example2.js):
var list=document.getElementsByTagName("ul");
var secondlist=list[1];
var secondlistitem=secondlist.getElementsByTagName("li");
alert(secondlistitem);希望在弹出框中显示“head”和“body”,谢谢各位了!
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script type="text/javascript" src="example2.js"></script>
</HEAD> <BODY>
<p>
There are three different types of element in this body:
</p>
<ul>
<li>
paragraph
</li>
<li>
unorder list
</li>
<li>
list item
</li>
</ul>
<p>
There are two children of html
</p>
<ul>
<li>
head
</li>
<li>
body
</li>
</ul>
</BODY>
</HTML>这是js文件代码(文件名为example2.js):
var list=document.getElementsByTagName("ul");
var secondlist=list[1];
var secondlistitem=secondlist.getElementsByTagName("li");
alert(secondlistitem);希望在弹出框中显示“head”和“body”,谢谢各位了!
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Author" CONTENT="theforever">
<META NAME="Generator" CONTENT="NotePad">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<p>There are three different types of element in this body:</p>
<ul>
<li>paragraph</li>
<li>unorder list</li>
<li>list item</li>
</ul>
<p>There are two children of html</p>
<ul>
<li id="a">head</li>
<li id="b">body</li>
</ul>
</BODY>
</HTML>
<script>
alert(document.getElementsByTagName("UL")[1].children(0).innerText);
alert(document.getElementsByTagName("UL")[1].children(1).innerText);
</script>
var secondlist=list[1];
var secondlistitem=secondlist.getElementsByTagName("li");
alert(secondlistitem[0].innerText);
alert(secondlistitem[1].innerText);
alert($($("ul")[1]).text());
document.getElementsByTagName("UL")取出的是多个。
多谢了
<SCRIPT LANGUAGE="JavaScript">
function ok()
{
window.open("temp.asp"),"myweb","height=200,width=400,top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no,fullscreen=yes";
}
想通过调用来生成一个光板全屏的新页面,但依然有菜单和地址栏,也没有全屏,是不是因为我用的是IE8?有啥办法可以解决呀?急求
alert(secondlistitem[1].innerText);