-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
  • 331,213
  • 40
  • 305
  • 339
Thomas
  • 33,544
  • 126
  • 357
  • 626

1 Answers1

0
$(document).ready(function(){
    $('a:not(".noclass")').each(function(index) {
        alert(index + ': ' + $(this).text());
    });
});
Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
Vinod Bhavnani
  • 2,185
  • 1
  • 16
  • 19