getElementsByClassName Help (Uncaught reference error when assigning to variable)
<p>Having some trouble selecting class names with plain 'ol vanilla javascript:</p>

<pre><code>var email = document.getElementsByClassName('email');
var phone = document.getElementsByClassName('phone');
// Hide phone by default
phone.style.display = "none";

function showContact() {
    var dropdown = document.getElementById( "contact-select" );        // Get a reference to the dropdown (select) element
    var selectedItemValue = dropdown.options[ dropdown.selectedIndex ].value; // use the dropdown reference to get the selected item's value

    if ( selectedItemValue === "phone" ) {
        email.style.display = "none";
        phone.style.display = "block";
    } else {
        phone.style.display = "none";
        email.style.display = "block";
    }
}
</code></pre>

<p>Keep getting an undefined error anytime I try to call one of the variables. Any help would be greatly appreciated. Thanks!</p>
