Skip to content

Instantly share code, notes, and snippets.

@aonurdemir
Created March 5, 2020 07:14
Show Gist options
  • Save aonurdemir/15f779e5d7a21e8c1ca4865b05cf71d7 to your computer and use it in GitHub Desktop.
Save aonurdemir/15f779e5d7a21e8c1ca4865b05cf71d7 to your computer and use it in GitHub Desktop.
Find modify and remove elements in javascript
$( ".container" )
.contents()
.filter(function() {
return this.nodeType === 3;
})
.wrap( "<p></p>" )
.end()
.filter( "br" )
.remove();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment