0
Hello,
I have 3 div’s: one that works as a button and two other as a color box.
I need you to click on div
that works as a button to div
COLOUR 2 close and the COLOUR 1 be visible.
This one works as a button:
<div onclick="Mudarestado('minhaDiv')">ALTERNAR</div>
These are color boxes:
<div id="minhaDiv" style="display:none;">COR 1</div>
<div id="minhaDiv" style="display:block;">COR 2</div>
Java Script:
<script type="text/javascript">
function confirmadeletar(el) {
var display = document.getElementById(el).style.display;
if(display == "none")
document.getElementById(el).style.display = 'block';
else
document.getElementById(el).style.display = 'none';
}
</script>
did you notice that the id of the Divs are equal? id="myDiv"
– Oliveira
ideal in this case is to have a single div and then switch the css class each with different style
– Will Knippelberg