Does jQuery attr allow for non standards?
问题 I am already using id and title but i need to parse through 2 more bits... $(this).attr("title"); $(this).attr("id"); Will $(this).attr("custom1"); work ?? 回答1: yes, and BTW you can set multiple attributes at once: $('.myselector').attr({ src: 'thefile.gif', width: 200, height: 300 }); 回答2: Yes, and you can use it for all of the data-attributes in HTML5. Which is the preferrable way to add extra attributes. Additionally, all data-* attributes are automatically added to jQuery's data() object