JavaScript Question dealing with different browsers

后端 未结 5 1547
抹茶落季
抹茶落季 2021-01-27 13:03

The problem that I\'m having is that my code works fine in JavaScript but doesn\'t work correctly in Firefox or safari and wondering why. What I\'m doing is I have a loop going

5条回答
  •  梦谈多话
    2021-01-27 13:16

    Try using document.getElementsByTagName, as I believe this is supported across all browsers.

    var linkList = document.getElementsByTagName("a");
    

提交回复
热议问题