Access element, which contains current [removed]

后端 未结 2 538
失恋的感觉
失恋的感觉 2021-01-25 14:02

I\'ve got following page:

2条回答
  •  抹茶落季
    2021-01-25 14:27

    You can try this, though it's somewhat of a hack:

    (function() {
      var scr = document.getElementsByTagName('script'),
          parent = scr[scr.length - 1].parentNode;
      // parent is the parent node of the last script on the page
    })();
    

    If you've got code in

提交回复
热议问题