javascript - Instead of get element by Id. How to get element by class? -


it doesn't seem working, idea went wrong? if use getelementbyid..it works.. not this. please help.

    <script type="text/javascript">     function conceal() {         if (document.getelementsbyclassname('tick').style.display == 'block') {             document.getelementsbyclassname('tick').style.display = 'none';         }     }      </script> 

use jquery class-selector.

<p class="myclass">hello world!</p> 

then

$(".myclass").dowhatever(); 

Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -