Is there a way to get the style: display attribute which would have either none or block?
部门:
<div id="ctl00_MainContentAreaPlaceHolder_cellPhone_input_msg_container" class="Error cellphone" style="display: block;">
<p class="cellphone" style="display: block;">Text</p>
</div>
我知道有一种方法可以找出DIV是否隐藏,但在我的例子中,这个div是动态注入的,因此它总是显示为可见的false,因此我不能使用它:
$j('.Error .cellphone').is(':hidden')
我可以使用以下命令获得"DISPLAY:挡路"结果:
$j('div.contextualError.ckgcellphone').attr('style')
有没有办法只获取"block"或"none"的值,或者有没有更好/更有效的方法?