Why is it that when I try to have two overlays with different messages display upon clicking buttons, they both end up showing the same message? Even after changing the ID tag names, the issue persists. Can someone shed some light on what might be causing this?
`function on() {
document.getElementById("btn1").style.display = "block";
}
function off() {
document.getElementById("overlay").style.display = "none";
}
function on() {
document.getElementById("overlay2").style.display = "block";
}
function off() {
document.getElementById("overlay2").style.display = "none";
}
<body>
<table width="600px" border="0" bordercolor="" cellspacing="0" cellpadding="0">
<tbody>
<!-- start of Sku 1-->
<td width="250" align="center">
<div class="polaroid">
<div id="overlay" onclick="off()">
<div id="text">Co flex , the best product in the world. Yes this is a rainbow color product but
loving this is the collest thing you could ever do. Im serious this is the best product in the
planet. Let me tell you what you need to play with so that you could get this amazing
product</div>
</div>
<button id="btn1" onclick="on()">Product Information</button>
<img src="https://s3.amazonaws.com/cdn.shopmedvet.com/images/large/COFLEX-VET4.jpg" alt"coflex"
style="width: "350px">
<div class="container">
<!-- start of form submission code-->
<div class="form-group " width="281">
<label for="field_330" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'sans-serif';
font-size: 14px; font-weight: bold">SKU: 46711-212X
<h4>Retail: <h3 style="font-size:20px">$9.99</h3></h4>
<div class=SKuQTY>
<label for="field_328" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'sans-serif';
font-size: 14px; font-weight: bold">Quantity</label>
</div>
<input class="form-control" type="text" name="field_328" id="field_328" value="" size="4"
maxlength="6" > </div> <span class="help-block">
<br>
</br>
<label for="field_329" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'sans-
serif'; font-size: 14px; font-weight: bold">Make A Deal</label>
<div class="Sku1">
<input class="form-control" type="text" name="field_329" id="field_329" value=""
size="4" maxlength="6" >
</div>
</div>
</div>
</div> </td>
<!-- start of Sku
1-->
<td width="250" align="center">
<div class="polaroid2">
<div id="overlay2" onclick="off()">
<div id="text2"> helllo</div>
</div>
<button id="btn2" onclick="on()">Product Information</button>
<img src="https://s3.amazonaws.com/cdn.shopmedvet.com/images/large/COFLEX-VET4.jpg"
alt"coflex" style="width: "350px">
<div class="container2">
<!-- start of form submission code-->
<div class="form-group " width="281">
<label for="field_330" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'sans-
serif'; font-size: 14px; font-weight: bold">SKU: 46711-212X
<h4>Retail: <h3 style="font-size:20px">$9.99</h3></h4>
<div class=SKuQTY>
<label for="field_328" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'sans-
serif'; font-size: 14px; font-weight: bold">Quantity</label>
</div>
<input class="form-control" type="text" name="field_328" id="field_328"
value="" size="4" maxlength="6" > </div> <span class="help-block">
<br>
</br>
<label for="field_329" style="font-family: 'Helvetica Neue', Helvetica,
Arial, 'sans-serif'; font-size: 14px; font-weight: bold">Make A Deal</label>
<div class="Sku1">
<input class="form-control" type="text" name="field_329" id="field_329"
value="" size="4" maxlength="6" >
</div>
</div>
</div>
</div> </td>
</table>
</body>