Skip to content

Instantly share code, notes, and snippets.

@Mashpy
Created May 22, 2016 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mashpy/e1c0d8c8b42faeb4a80a33878de77e1a to your computer and use it in GitHub Desktop.
Save Mashpy/e1c0d8c8b42faeb4a80a33878de77e1a to your computer and use it in GitHub Desktop.
<head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.2.min.js"></script>
</head>
<script>
$( document ).ready(function() {
$('.telephone').each(function(index){
var tel = $(this).attr('href');
var text_val = 'tel:'+ $(this).text().replace('-', '');
if(text_val != tel){
alert(text_val);
}
});
$('.email').each(function(index){
var tel = $.trim($(this).attr('href'));
var text_val = 'mailto:'+ $.trim($(this).text());
if(text_val != tel){
alert(text_val);
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment