Home > Web Front-end > HTML Tutorial > Please ask a simple question_html/css_WEB-ITnose

Please ask a simple question_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:16:00
Original
887 people have browsed it

<script> <br> var divs=document.getElementsByTagName("div"); <br> var ruku; <br> var banhao; <br> var tmp; <br> for(var i=0; i<divs.length;i ) <br /> { <br /> if(divs[i].innerHTML=="Page Display") <br /> { <br /> ruku=divs[i].parentNode.nextSibling.firstChild; //Why can't this be achieved using the comment section below? <br /> } <br /> } <br /> <br /> <br /> ruku=divs[i].parentNode.nextSibling.childNodes; <br /> ruku=ruku[1].value;//What’s wrong with this sentence<br /> ruku=divs[i].parentNode.nextSibling.childNodes[1];//What is the error in this sentence? <br /> </script>


Reply to discussion (solution)

ruku=ruku[1].value should be [0]

Sorry, firstChild is labeled 0, not 1
ruku=ruku[0].value is correct

Related labels:
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