亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么alert出來的值是0,這樣沒法繼續寫了

<!DOCTYPE html>

<html>

<head>

? ? <meta charset="UTF-8">

? ? <title>實踐題 - 選項卡</title>

? ? <style type="text/css">

? ? ? ?#ul li{float:left;border-right:1px solid gray;border-left:1px solid gray;margin-right:10px;padding:5px 10px;

? ? ? ?width:50px;text-align:center;vertical-align:middle;}

? ? ? ?#ul{overflow:auto;margin-left:2px;z-index:999;position:relative;margin-top:1px;}

? ? ? ?*{list-style:none;margin:0;padding:0;}

? ? ? ?.li_second,.li_third{border-top:1px solid gray;

? ? ? ? ? ? ? ? ? ? ? ? ? ? border-bottom:1px solid red;}

? ? ? ?.li_first{border-bottom:1px solid white;

? ? ? ? ? ? ? ? ?border-top:1px solid red;}

? ? ? ?

? ? ? ?.content{border-left:1px solid blue;

? ? ? ? ? ? ? ? border-right:1px solid blue;

? ? ? ? ? ? ? ? border-bottom:1px solid blue;

? ? ? ? ? ? ? ? border-top:1px solid red;width:280px;

? ? ? ? ? ? ? ? position:absolute;top:31px;

? ? ? ?}

? ? </style>

? ? <script type="text/javascript">

? ? ? ?

? ? ?

? ? ? ? ? var x=document.getElementsByTagName("li");

? ? ?alert(x.length);

? ? ??

? ??

? ? </script>

?

</head>

<body>

<div id="div">

<ul id="ul">

? ? <li class="li_first">房產</li>

? ? <li class="li_second">家居</li>

? ? <li class="li_third">二手房</li>

</ul>

</div>

<div class="content">275萬購昌平鄰鐵三居 總價20萬買一居</br>

? ? ?200萬內購五環三居 140萬安家東三環</br>

? ? ?北京首現零首付樓盤 53萬購東5環50平</br>

? ? ?京樓盤直降5000 中信府 公園樓王現房

</div>



?

</body>

</html>


正在回答

1 回答

你可以試試不要alert 。然后繼續寫。

0 回復 有任何疑惑可以回復我~
#1

xymashiro 提問者

試過了,這個length值是0,后面繼續寫出來都調用不了
2018-03-01 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么alert出來的值是0,這樣沒法繼續寫了

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號