html - Javascript inside php not working -
i have script inside php change display of div
when checkbox checked, checkbox location different place script located.
the snippets of code shown below
if($_post['test'] == 1) { echo "<script> document.getelementbyid('seoterm').style.display='block';</script>";}
i placed above code in head
of current page. when $_post['test']
1
, display of div
id seoterm
still none, instead of block.
what's problem here ?
it might fire in order manipulate dom.
try:
<script> window.onload = function(){ document.getelementbyid('seoterm').style.display='block'; }; </script>
Comments
Post a Comment