Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<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
You can’t perform that action at this time.