这是一个跟上一个似乎混淆了人的问题,所以我会稍微净化一下。这里有一些标记。使用jQuery进行编程挑战
<div class="button width120 height30 iconLeft colorRed"></div>
<div class="button width180 height20 iconPlus colorBlue"></div>
<div class="button width200 height10 iconStar colorGreen"></div>
<div class="button width110 height60 iconBack colorOrange"></div>
挑战是填写下面的代码。现在
$(".button").each(function(){
// Get the width from the class
// Get the height from the class
// Get the icon from the class
// Get the color from the class
});
,我知道,你不应该用这样的方式,所以我不是在寻找这样做的替代方法类,这是一个实验,我想知道是否有可能做到这一点这条路。
这是CSS矫枉过正 – tj111 2009-04-16 19:31:19