Suppose I have a div with a string of characters and I want to see if there is a specific word and do something:
$('.container-text:contains("text")').addClass('container-text-right');
But how do I check if I want him to check more than one word and then do something according to a certain condition? for example ...
if($('.container-text:contains("texto1")')){
$('.container-text').addClass('container-text-right');
// y hacer algo más
} else if ($('.container-text:contains("texto2")')){
$('.container-text').addClass('container-text-right');
// y hacer algo más
}
This is how I want to check it but I do not give with it, what do you say to me?