Javascript - Putting element in a var but can't change style
<p>I have a function that is called when an element is clicked. </p>

<pre><code>function showHide(elem){    
        var clickedText = elem.getElementsByTagName("p");
        clickedText.style.color = "green";

    }
</code></pre>

<p>When I run this code I get an <code>Uncaught TypeError: Cannot set property 'color' of undefined</code>. However, if I do <code>console.log(clickedText)</code> it logs the appropriate <p> tag. Can't for the life of me figure out why this isn't working, have I missed something totally obvious?</p>
