Jquery custom attributes

You can do this, use data- attributes though (part of the HTML5 specification), like this:

<li data-something="CommonLi"></li> 

jQuery even has built-in support for these in 1.4.3+, for example:

$("li").data("something") //"CommonLi"

For your other questions:

  • They’ll validate if it’s HTML5 – but won’t break anything in HTML4
  • This shouldn’t interfere with the designer, but it’ll depend on which designer
  • If you’re fetching from an element, the performance is the same as any other attribute

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)