I have a script inside php that will change the display of a div when a checkbox is checked, the checkbox location is different from the place where the script is located.
the snippets of the code is shown below
if($_POST['test'] == 1)
{
echo "<script> document.getElementById('seoTerm').style.display='block';</script>";}
I placed the above code in the head of the current page. When the $_POST['test'] is 1, the display of the div with id seoTerm is still none, instead of block.
What's the problem here ?
divwith the idseoTermlocated before or after the script tag?