Skip to content

Instantly share code, notes, and snippets.

@0xnbk
Created September 13, 2010 04:16
Show Gist options
  • Save 0xnbk/576796 to your computer and use it in GitHub Desktop.
Save 0xnbk/576796 to your computer and use it in GitHub Desktop.
Remove a word in a text
var el = $('#id');
el.html(el.html().replace(/word/ig, ""));
@0xnbk
Copy link
Author

0xnbk commented Sep 13, 2010

Remove a word in a text

Do you ever wanted to be able to remove words in a text? Note that the following code can be easily modified to replace a word by another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment