javascript - Instead of get element by Id. How to get element by class? -
this question has answer here:
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
Post a Comment