Javascript: textContent based on textLength
<p>Hi all (first poster so don't shoot me...yet):</p>

<p>I'm trying to alter a textarea based on the textlength.</p>

<p>My code is as follow:</p>

<pre><code>&lt;script type="text/javascript"&gt;
            function addComment(){
                var commentBank = document.getElementById("commentBank");
                var selectedComment = commentBank.options[commentBank.selectedIndex].text;
                var currentComment = document.getElementById("comment");

                console.log(currentComment.textLength);

                if(currentComment.textContent == "Add comment here" ){
                    currentComment.textContent = selectedComment;
                }else if(currentComment.textLength == 0){
                    console.log("Trying to add "+selectedComment);
                    currentComment.textContent = "selectedComment";
                }
                else{
                currentComment.textContent += ". " + selectedComment;
                }


            }
            &lt;/script&gt;
</code></pre>

<p>What I'm trying to do is get the selected item from a option (called commentBank), from this, get the text selected and add it to a textarea (called comment).</p>

<p>The issue at present is that when currentComment.textContent () is equal to 0, it doesn't add the text to the textarea.
It does output to the log however, doesn't update the textarea to add the text, so the if statement is working.</p>

<p>Any ideas?
Thanks in advanced.</p>
