5.5.js 332 B

123456789101112
  1. $(document).ready(function() {
  2. // Use attr() to add an id, rel, and title.
  3. $('div.chapter a[href*="wikipedia"]').attr({
  4. rel: 'external',
  5. title: function() {
  6. return 'Learn more about ' + $(this).text() + ' at Wikipedia.';
  7. },
  8. id: function(index, oldValue) {
  9. return 'wikilink-' + index;
  10. }
  11. });
  12. });