How do you get elements from a javascript HTMLCollection

后端 未结 3 1122
迷失自我
迷失自我 2021-02-07 04:30

I can\'t understand why I cant get elements from a HtmlCollection. This code example:

 var col = (document.getElementsByClassName(\"jcrop-holder\"));
 console.lo         


        
3条回答
  •  礼貌的吻别
    2021-02-07 05:01

    I was facing the same issue and the solution to this problem was to place my script in the end of the document, in order to wait to the whole document to be loaded before start changing or selecting the HTMLCollection elements. Hope it helps.

提交回复
热议问题