如同標題,只要用加上 id,基本上都可以直接 console.log 出來 dom element,除非你用其他變數覆蓋過去,小觀念。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="sample"></div> | |
<script type="text/javascript"> | |
console.log(sample); | |
</script> |
沒有留言:
張貼留言