Skip to content

Instantly share code, notes, and snippets.

@jboesch
Created July 8, 2011 20:01
Show Gist options
  • Save jboesch/1072690 to your computer and use it in GitHub Desktop.
Save jboesch/1072690 to your computer and use it in GitHub Desktop.
Remove a text node
// This will remove the text "Search:"
$('#thing').contents().each(function(){
if(this.nodeType == 3){
$(this).remove();
}
});
<div id="thing">
Search:
<input type="text" />
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment