jQuery selector returns prevObject instead of normal element

后端 未结 4 1159
一生所求
一生所求 2021-02-01 02:22

I have some problems with selecting elements, with Jquery. When i try to select a element:

var images = $(\"#htmlChunk\").find(\"img.Thumb\");
console.log(images         


        
4条回答
  •  长发绾君心
    2021-02-01 03:02

    try this.

       function getId() {
                 var ids = $(".htmlChunk").find("img.thumb"); //it wiill return array of image
                 var sid = $(".htmlChunk").find("img#img2"); //it wiill return wat image you want
                 $(".htmlChunk span").text("arrays:" + ids[0] + "  :  " + ids[1] +
                 "simple imge:" + sid);
             }
    
    
        
    
    
      

提交回复
热议问题