Skip to content

Instantly share code, notes, and snippets.

@versluis versluis/vanish.html
Last active Apr 10, 2019

What would you like to do?
Make empty links disappear from the DOM
<p class="one"><a href=''>This line shall vanish.</a></p>
<p class="one"><a href=''>This line shall prevail.</a></p>
<p>The End.</p>
// make empty links vanish
$('.one a').each(function() {
if(!$(this).attr('href')) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.