Created
July 3, 2012 16:43
-
-
Save Wilto/3040913 to your computer and use it in GitHub Desktop.
Hide and Tel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var links = document.getElementsByTagName( "a" ); | |
for ( var i = 0, a = links.length; i < a; i++ ) { | |
if( links[ i ].href.indexOf( "tel" ) > -1 ) { | |
var el = links[ i ], | |
parent = el.parentNode, | |
num = document.createTextNode( el.innerHTML ); | |
if( el.className.indexOf( "tel" ) === -1 || !parent.className.indexOf( "tel" ) === -1 ) { | |
parent.replaceChild( num, el ); | |
} | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment