如果具有特定文本的id div,则删除其他div。
<script language="javascript">
var text = $('#div_with_dynamic_text').text();
var comparingText = 'THE_TEXT'
if(text == comparingText){
$('#OTHER_DIV).css('display','none');
};
</script>
<div id="div_with_dynamic_text">THE_TEXT</div>
<div id="OTHER_DIV"> some other div which needs to hide if certain text</div>
$('#OTHER_DIV')
中缺少一个闭合单引号 - 这是问题吗还是只是你问题中的一个打字错误? - Nate Pinchot