課程
/前端開發
/JavaScript
/JavaScript進階篇
function get_nextSibling(n)不懂“n”是什么意思
2015-10-09
源自:JavaScript進階篇 9-11
正在回答
<script type="text/javascript">
? ? function get_nextSibling(n){
? ? document.write("n的值為:"+n.value);
? ? ? ? var x=n.nextSibling;
? ? ? ? while (x && x.nodeType!=1){
? ? ? ? ? ? x=x.nextSibling;
? ? ? ? }
? ? ? ? return x;
? ? }
? ? var x=document.getElementsByTagName("li")[0];
? ? document.write("x的值為:"+x.value+"<br/>"+x.nodeValue+"<br/>"+x.nodeName+"<br/>"+x.nodeType+"<br/>");
y=get_nextSibling(x);
</script>
函數參數
舉報
本課程從如何插入JS代碼開始,帶您進入網頁動態交互世界
6 回答依舊不懂get_nextSibling(n)
1 回答這節課 function get_nextSibling(n)
1 回答function 函數名稱(n) 中的“n”是什么意思
3 回答function get_nextSibling(n)的n是什么?而且為什么要判斷是不是元素節點?
4 回答n是什么意思?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2015-11-03
<script type="text/javascript">
? ? function get_nextSibling(n){
? ? document.write("n的值為:"+n.value);
? ? ? ? var x=n.nextSibling;
? ? ? ? while (x && x.nodeType!=1){
? ? ? ? ? ? x=x.nextSibling;
? ? ? ? }
? ? ? ? return x;
? ? }
? ? var x=document.getElementsByTagName("li")[0];
? ? document.write("x的值為:"+x.value+"<br/>"+x.nodeValue+"<br/>"+x.nodeName+"<br/>"+x.nodeType+"<br/>");
y=get_nextSibling(x);
</script>
2015-10-09
函數參數