I've got such structure of the part of the site:
<p>content content</p>
<div id=myDiv1>content content</div>
<p>content content</p>
<div id=myDiv2>content content</div>
No I want to hide let's say 'myDiv2'. So I write in JS:
document.getElementById('myDiv2').style.display = 'none'
And now, how to hide also the paragraph which is before the 'myDiv2' div ?
How to check if the first element before 'myDiv2' is a paraghraph ?
Regards,
sc