How can i find date in div tag and change the date to some other text?

Viewed 17

I have date in between a div tag: 9th July 2022. I have to find this date and change to some other text. How can I achieve this ?

  <div class="w3_bg">
    <a href="www.foo.com">Mayuresh</a>
  </div>
  /&nbsp; 9th July 2022
</div>

I have tried like this

var userInput = "202";
var aa=$(".w3_bg:contains(" + userInput + ")"); 
$(document).ready(function(){
$(".w3_bg").text("sometext");
});
0 Answers
Related