您可能已经知道,HTML5 allows more characters to be used in ID names - 请参阅the HTML5 spec,它现在有空格作为唯一无效字符。试图在JQuery中使用它显示JQuery忽略特定有效字符'/'后的ID中的所有字符。 <section>
<div id='foo/bar'>
YAAY
</div>
我需要在页面上放置一些由Raphaël生成的spinners。但是我可以只创建一个微调,因为Raphaël通过id选择元素。我如何通过类来选择多个元素?我尝试使用jQuery: var spinners = $('div.spinners');
var r = Raphael(spinners, 320, 200);
但它不起作用。
可能重复: jQuery OR Selector? 我想在为每一个匹配select找到第一个option,要么有一类placeholder或空值的东西沿着线 $(selectorOrJquery).find('select').andSelf().filter('select')
.find('(option.placeholder OR option[value=""]):first)