Kristinn Sigmundsson wrote:
> It is always (if not then atleast almost always) possible to do thing
> like you describe without using custom attributes, BUT don't you think
> that arnauds example makes more sense, codewise?
> 
> That way you can set the attribs easily
> ($(something).attr("selectableday, "1")) and then get all the
> selectable days with $([EMAIL PROTECTED]).
> 
> I've just seen to many examples of javascript "tools" that use custom
> strings in every availible attribute there is, for this to make any
> sense anymore.
> 
> Is there any downside for using this?
> 
> On 1/25/07, Olaf Bosch <[EMAIL PROTECTED]> wrote:
>> arnaud sellenet schrieb:
>>
>>> Do you think of a better way, without using a custom attribute (I'm
>>> not 100% sure but seems like you can't use numeric classes nor id
>>> right ?)
>> Yes you have a way. Append a second class, so:
>>
>> <div class="calendarmonth"><h3>January</h3>
>>         <div  class="calendarday">1</div>
>>         <div  class="calendarday">2</div>
>>         ....
>>         <div  class="calendarday">23</div>
>>         <div  class="calendarday selectableday1">24</div>
>>         <div  class="calendarday selectableday2">25</div>
>>         .....
>>         <div  class="calendarday selectableday41">15</div>
>> </div>
>>
>> Then strip the string "selectableday" from the class in the script and
>> you have the numbers from custom attribute to do what you will.


Just be a little careful with custom attributes. I have seen people 
using custom attributes that clashed with WebForms which Opera has 
started to implement.

That's the good thing about standards. You can rely on them ;-)


-- Klaus


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to