Skip to content

Instantly share code, notes, and snippets.

@karbassi
Created December 11, 2009 01:08
Show Gist options
  • Save karbassi/253878 to your computer and use it in GitHub Desktop.
Save karbassi/253878 to your computer and use it in GitHub Desktop.
// I was bored.
// Sorry :(
function d(id){ return document.getElementById(id); }
window.onload = function(){
var email_only = d('email_only'),
mail_only = d('mail_only'),
phone_only = d('phone_only');
mail_only.style.display = phone_only.style.display = 'none';
d('contact_us_stype_email').onclick = function () {
email_only.style.display = 'block';
mail_only.style.display = phone_only.style.display = 'none';
};
d('contact_us_stype_mail').onclick = function () {
mail_only.style.display = 'block';
email_only.style.display = phone_only.style.display = 'none';
};
d('contact_us_stype_phone').onclick = function () {
phone_only.style.display = 'block';
email_only.style.display = mail_only.style.display = 'none';
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment