我有这个 div ( <div id="slideshow">
)。
在 index.php 中已满。
在其他页面是空的。 (我使用 Joomla,这是一个模块)。
现在,什么时候满了,没关系。
但是,当它为空时,我想更改下一个 div 的 css 属性。
(<div id="slideshow">...</div><section>....</section>
)。
现在,我试试这段代码:
alert($("div#slideshow").text() == "");
alert($("div#slideshow").is(':empty'));
所有页面的结果都是:False,False。
错误的???对全部?
附:对于空我想说这个(<div id="slideshow"></div>
)。
感谢您的回答。
我明白哪里错了。
我看到了 chrome ( <div id="slideshow"></div>
),但是将它复制为 html 给了我这个:
<div id="slideshow">
</div>
所以它不是空的! 现在我想知道,我该如何继续?
最佳答案
这个元素的文本是 != ""
但它是空的:
<div> </div>
关于javascript - 分区是空的。使用 jQuery...错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10007552/