<div id=a style="background:red;height:100px;width:100px">hahahahah</div>
<script>
var a=$('#a')
console.log(a.innerHTML)
var b=document.getElementById("a")
console.log(b.innerHTML)
</script>

解决方案 »

  1.   

    要 $('#a')[0]<div id=a style="background:red;height:100px;width:100px">hahahahah</div>
            <script>
                var a=$('#a')[0];
                console.log(a.innerHTML)
                var b=document.getElementById("a")
                console.log(b.innerHTML)
            </script>
      

  2.   

    楼上的正解.
     document.getElementById('a') 返回的是 HTML DOM对象.
    而$('#a')返回的是JQuery 对象.
     如果要使用DOM方法,得需要先转换为HTML DOM对象.