and javasript would be like this ? Please correct me

<script> 
function validateComment() {
var value = $("[class=commentbox]").val(); 
var word = value.toLowerCase();
    // make sure this word is lowercase
if( document.myForma.commentbox.value == "" )
   { document.getElementsByClassName('comment-error').innerHTML = '<style> #error-comment-info_empty {display:block !important; }</style>';  return false;  }
 if (word.indexOf("bad-word") != -1) {
       document.getElementsByClassName('comment-error').innerHTML = '<style> #error-comment-info {display:block !important; }</style>';    return false;} 
 if (word.indexOf("bad-word") != -1) {
       document.getElementsByClassName('comment-error').innerHTML = '<style> #error-comment-info {display:block !important; }</style>';   return false;} 
       if (word.indexOf("bad-word") != -1) {
       document.getElementsByClassName('comment-error').innerHTML = '<style> #error-comment-info {display:block !important; }</style>'; return false;} 
       if (word.indexOf("bad-word") != -1) {
       document.getElementsByClassName('comment-error').innerHTML = '<style> #error-comment-info {display:block !important; }</style>';   return false;}
 else { 
  return false;
  }
}
</script>

Is

getElementsByClassName

right? OR should I use

getElementByClassName

Could you please give an example of using class
??

that's not the solution I'm looking for... I need to select all with the same id or class...

Hello everyone,
I'm trying to select same "id" for more than one input. My code works with 1 input, but when I add 2 textareas or more my code stops working...

Here's my code:

Javascript

   *<script> 
function validateComment() {

var value = $("[id=commentbox]").val(); 

var word = value.toLowerCase();

    // make sure this word is lowercase
if( document.myForma.commentbox.value == "" )
   { document.getElementById('comment-error').innerHTML = '<style> #error-comment-info_empty {display:block !important; }</style>';  return false;  }

 if (word.indexOf("bad-word") != -1) {
       document.getElementById('comment-error').innerHTML = '<style> #error-comment-info {display:block !important; }</style>';    return false;} 
 if (word.indexOf("bad-word") != -1) {
       document.getElementById('comment-error').innerHTML = '<style> #error-comment-info {display:block !important; }</style>';   return false;} 

       if (word.indexOf("bad-word") != -1) {
       document.getElementById('comment-error').innerHTML = '<style> #error-comment-info {display:block !important; }</style>'; return false;} 

       if (word.indexOf("bad-word") != -1) {
       document.getElementById('comment-error').innerHTML = '<style> #error-comment-info {display:block !important; }</style>';   return false;}

 else { 

  return false;
  }

}
</script>*

  <textarea id="commentbox" class="auto" rows="2" data-min-rows="2" name="commentbox" placeholder="Write your staff here ..."></textarea>  

   <textarea id="commentbox" class="auto" rows="2" data-min-rows="2" name="commentbox" placeholder="Write your staff here ..."></textarea>

Thanks :)