Created
September 7, 2012 00:26
-
-
Save alexanderscott/3661846 to your computer and use it in GitHub Desktop.
Phone number formatting for mobile
This file contains 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
/* | |
* Re-formats a number for phone call | |
* Takes (555) 555-5555 and replaces with 5555555555 | |
* To make a call from mobile use <a href="tel:XXX-XXX-XXXX"> | |
*/ | |
var raw_phoneNum = formatted_phoneNum.replace(/\)\s*|\(\s*|-/g, ''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment