jquery .html()删除html内容

时间:2012-08-22 16:06:32

标签: innerhtml

我有些问题。 我必须删除我的.html()jquery函数的内容。一切正常,但我的iphone phonegap应用程序的页脚上升。但是当我在我的html代码中直接评论或删除我的内容时,一切正常,我的应用程序的页脚留在他的位置。请帮我。 这是我的代码片段:

<script id="div_mainheader" type="text/html">

        <div id="check_place">
            <div id="idcheckin" style="width: 210px; position: relative;" align="left" class="mystatus2 clickable" onclick='showPartnersNearYouPopUp();'>
                <div id="leave" style="top: 81px;"><img src="graphics/picker.png" style="margin-left: 5px; margin-top: 5px; margin-bottom: -1px;">

                    CHECK A PLACE ...

                </div>
            </div> 

            <div id="idbtleave" style="position: absolute; top: 81px; left: 270px;">
                <button id="btleave" class="checkout-button" type="button">{{Localize.quit}}</button>
            </div>
        </div>

    </script>

这是我打电话来删除我的内容的函数:

$('#check_place').html('');

我也试过document.getElementById('check_place').innerrHTML = '';但是.html()

也是一样的

请帮帮我。非常感谢。

1 个答案:

答案 0 :(得分:2)

使用

$('#check_place').empty();