Am trying to style my textarea with some JAVASCRIPT and CSS so when clicked it should change size expand to 120px height from 20px height by document.getElementById("tweet_area")
but the textarea is expanding when you just made any click in the page not clicking the textarea. can one collect me on this am new to JavaScript
<script language="javascript">
document.onclick=changeElement;
function changeElement() {
var textarea = document.getElementById("tweet_area");
textarea.style.backgroundColor="#fff";
textarea.style.width="565px";
textarea.style.color="#000";
textarea.style.height="120px";
textarea.style.paddingLeft="1px";
textarea.style.paddingTop="1px";
textarea.style.fontFamily="Tahoma";
textarea.style.fontSize="10pt";
textarea.style.border="groove 1px #e5eaf1";
textarea.style.position="inherit";
textarea.style.textDecoration="none";
}
</script>
<style type="text/css">
#tweet_area{
width:565px;
height:25px;
overflow:hidden;
margin:1px auto;
font-family:Tahoma;
font-size:10pt;
font-weight:400px;
color:#000;
max-width:565px;
min-width:565px;
min-height:25px;
max-height:120px;
border:groove 1px #e5eaf1;
padding-right:10px;
}
</style>