0

Are custom link attributes allowed like "bid" in my example below? I need it for ajax calls. It works OK, I just want to be sure that it's legal.

<a href="#" class="morecomments" id="0-1" bid="1-1">Link</a>

$('.morecomments').live("click",function() {
var BID = $(this).attr("bid");
.....
}
user1821484
  • 273
  • 1
  • 4
  • 12

1 Answers1

0

Yes, they will work; but jQuery can also use .data() call to search for all attributes with data- prefix.

Read more about it here.

hjpotter92
  • 78,589
  • 36
  • 144
  • 183