日期:2014-05-17 浏览次数:20718 次
<script type="text/javascript"> jQuery(document).ready(function($){ var $div = $('div'); var $widthSpecified = $div.filter(function(){ return this.style.width != ''; null; }); var $widthUnspecified = $div.not($widthSpecified); alert($widthSpecified.length); alert($widthUnspecified.length); }); </script> <div style="width: 1px;"></div> <div></div> <div style="width: 2px;"></div>