这是一个示例html
<iframe id="theiframe">
...
<form>
<div class="pluginConnectButton">
<div class="pluginButton pluginButtonInline pluginConnectButtonDisconnected" title="">
...
</div>
<div class="pluginButton pluginButtonPressed pluginButtonInline pluginButtonX pluginConnectButtonConnected hidden_elem" title="">
...
</div>
</form>
...
</iframe>
我想如果带有类pluginButton pluginButtonInline pluginConnectButtonDisconnected的div具有类“hidden_elem”并且在idrame中具有id = theiframe,那么就做一些动作
答案 0 :(得分:0)
答案 1 :(得分:0)
尝试
var el = $('.pluginButton.pluginButtonInline.pluginConnectButtonDisconnected');
if(el.hasClass('hidden_elem') && el.closest('#theiframe').length){
//do something
}