日期:2014-05-16 浏览次数:20385 次
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<div id="id"></div>
<script type="text/javascript">
var s = $('<div></div>');
var a = $('#id');
alert($.contains(document.body, s[0]));
alert($.contains(document.body, a[0]));
</script>