首页 > 这样写为什么不报错?

这样写为什么不报错?

<div style="width:100px;height:100px;background: red;"></div>
<script>

var x

{$ : function $(el){
    return document.getElementsByTagName(el);
}
}

$("div")[0].style.width = "500px";
</script>

你在前面加个 "use strict";试试


为什么要报错?

【热门文章】
【热门文章】