bitte helfen Sie mir c wählen .. Hier ist der HTML-Code:DOM Navigation Problem,
<div id="a">
<div id="b"></div>
<div id="app7019261521_the_coin_9996544" style="left: 176px; top: 448px;">
<a href="d.com" onclick="(new Image()).src = '/ajax/ct.php?d_id=;action_type=d;post_form_id=6b; return true;"></a>
</div>
</div>
Und hier ist mein Javascript-Code:
var coin = document.querySelectorAll("a > [id^=app7019261521_the_coin]");
if (coin.length == 1) {
alert(coin.id);
} else if (coin.length == 0) {
window.location.reload();
}
Ich weiß nicht, das Problem, coin.length gibt 1 zurück Aber coin.id gibt immer undefined zurück, wo es zurückgeben sollte app7019261521_the_coin_9996544
Vielleicht ist es in der DOM-Navigation. Ich weiß es nicht. Bitte helfen Sie mir