Created
April 12, 2012 16:47
-
-
Save brianswisher/2369015 to your computer and use it in GitHub Desktop.
Handle multiple phone number w/ a single click
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
(function(){ | |
var contactLink = $('.btns.b a')[0]; | |
contactLink.setAttribute('question','Would you like to call toll free?'); | |
contactLink.setAttribute('toll','tel:1-415-555-5555'); | |
contactLink.setAttribute('tollfree','tel:1-800-555-5555'); | |
contactLink.setAttribute('onclick','var r=confirm(this.getAttribute("question")); if (r==true) { document.location=this.getAttribute("tollfree"); } else { document.location=this.getAttribute("toll"); } return false;'); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment