次のコード警告: "オブジェクトオブジェクトは、"jqueryオブジェクトを使用可能なHTMLに変換する方法は?
var shipImgs = $("#div").children();
alert(shipImgs);
divが4人の子供(画像タグ)が含まれています。
<div id="div">
<img src="/imgs/spaceship_still.jpg" alt="space"/>
<img src="/imgs/spaceship_laser.jpg" alt="space"/>
<img src="/imgs/spaceship_motion.jpg" alt="space"/>
<img src="/imgs/spaceship_destroyed.jpg" alt="space"/>
</div>
これらの画像をそれぞれ配列に追加したいと思います。しかし、私がそれを行う前に、私はshipImgsを処理する方法を知っている必要があります...どのようにオブジェクトにアクセスし、htmlを配列にプッシュすることができますか?
、jQueryのオブジェクトは単なる「装飾的な方法」3nigma @ – Joseph
おかげで配列である、第二部では、私が探していたまさにでした! –
喜んで助けた – Rafay