I am creating a chrome app and I need to change the id of a circle (it is tied to some CSS, so the id determines the color) to make the circle a different color. I also need to change the value of the button to "Lock". Note that this is a chrome app. Here is my JavaScript:
document.getElementById("clickme").addEventListener('click', function() {
document.getElementById('clickme').id = 'clicked';
}
if (document.getElementById('clickme').id = "clicked") {
document.getElementById('redcircle').id = 'greencircle';
document.getElementById('clicked').value = 'Lock';
}
And my HTML:
<tr>
<td>Door 116</td>
<td><span><div class="circle" id="redcircle"></div></span></td>
<td><button type="button" id="clickme" value="unlock">Unlock</button></td>