JQuery Tips相关(1)—-关于$.Ready()

2020-05-22 15:17:50易采站长站整理

</script>
</body>
<body>

<script type="text/javascript">

alert($("#test").html());//I Can't display the content

</script>
<div id="test">this is the content</div>
</body>

上面两段代码,第二段代码当中因为只能解释到当前代码之前的DOM,而test并不存在于已经解析的DOM数.所以第二段代码无法正确显示.