[Solved] If text() equal do something [closed]

[ad_1]

As a work around for this problem, you can use like this,

 var interval = setInterval(function() {
   if ($('.weatherCity').length) {
     $('.weatherCity').each(function() {
       if ($(this).text().trim() == 'London') {
         $(this).text('London Weather');
       }
     });
     clearInterval(interval);
   }
 }, 100);

Fiddle

Constantly checks for the element using setInterval and stop checking once it is found.

[ad_2]

solved If text() equal do something [closed]