jQuery/Javascript find and replace all instances

12,399

Use regex

"anyString".replace(/</g,'somethingElse');

If you want to replace it inside the div then try this.

$('#div').html($('#div').html().replace(/</g,'somethingElse'));
Share:
12,399
user1083320
Author by

user1083320

Updated on June 14, 2022

Comments