-2

i have many links in page but few links has few specific css class attached. i want to avoid those link which has .noclass attached.

i know this way i can iterate in all the links of page

$(document).ready(function(){
    $('a').each(function(index) {
        alert(index + ': ' + $(this).text());
    });
});

now tell me when i am iterating all links in page then how could mention to avoid few links which has .noclass attached ?

anyone can help me with example. thanks

Rory McCrossan
  • 319,460
  • 37
  • 290
  • 318
Thomas
  • 32,301
  • 119
  • 343
  • 612

1 Answers1

0
$(document).ready(function(){
    $('a:not(".noclass")').each(function(index) {
        alert(index + ': ' + $(this).text());
    });
});
Rory McCrossan
  • 319,460
  • 37
  • 290
  • 318
Vinod Bhavnani
  • 1,997
  • 1
  • 14
  • 19