SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist JordashTalon's Avatar
    Join Date
    Dec 2008
    Posts
    505
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript Custom Attributes - How many browsers does that work on?

    I have some attributes that aren't really standard attributes:

    e.g.

    <option additional="34">Deep Purple</option>

    That "additional" attribute is an attribute that I use with Jquery to add an additional price to the item.

    How many browsers will work with custom attributes like that? Or will I have to use a standard attribute (Note: if I use Value it overwrites the value inside of the option).

    Thanks for any help, hope the question makes sense.

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,139
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)
    It will function in all browsers though the HTML will never be valid. DOJO takes a similar approach… probably why I hate DOJO. That said, a class could probably be used instead.
    The only code I hate more than my own is everyone else's.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •