6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-21 21:31

    document.getElementsByTagName('a') returns an array thus try this:

        var arr = document.getElementsByTagName('a');
        for(var key in arr){
          arr[key].onclick = show;
        }
    

    Haven't tested it but it should work

提交回复
热议问题