1
$('div[id^="start_with"] and not [id$="end_with"]').each(function () {
    //TO DO
});

How to combine multiple selectors, if some of them is NOT?

1 Answer 1

1

Use :not() immediately(without any spaces) following the first attribute condition

$('div[id^="start_with"]:not([id$="end_with"])').each(function () {
    //TO DO
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.