我無法使用google標簽管理器從DOM頁面洗掉默認的專案型別和專案型別。
如何在google標簽管理器中使用javascript從上面的body標簽中洗掉itemtype和itemscope?
uj5u.com熱心網友回復:
你可以使用Element.removeAttribute()方法來從一個元素中移除你想要的屬性。在這種情況下,你可以像這樣做:
span class="hljs-variable language_">document. body.removeAttribute("itemtype") 。
document.body.removeAttribute("itemscope") 。
uj5u.com熱心網友回復:
這可以通過在google標簽管理器中添加這個自定義HTML標簽來完成:
<script>
var body = document.getElementsByTagName('body')[0] 。
body.removeAttribute("itemtype") 。
body.removeAttribute("itemscope") 。
</script>>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/320578.html
標籤:
