hide/ show 2 div tags based on click of a checkbox
Hello Experts,
I have 2 div tags like below
<div id="Div1" style="display:none;">some text</div>
<div id="Div2" style="display:none;"> some more text </div>
now the Div1 and Div2 are located in different parts of my web page, so the idea of wrapping both in one more DIV tag didnt work.
Now i have checkbox which basically says Check here if you want to see "SOME TEXT"
i know i can use this javascript to show and hide one DIV tag but not 2 DIV Tags at the same time
this is the code i have for one div tag
is it possible to show to div tags with a click of checkbox.
thanks and appreciate it
<input type="checkbox" value="yes" onclick="document.getElementById('Div2').style.display=(this.checked)?'inline':'none';" > check if to see SOME TEXT