-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

0

1 Answer 1

0
$(document).ready(function(){
    $('a:not(".noclass")').each(function(index) {
        alert(index + ': ' + $(this).text());
    });
});
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.