With the code below, I am trying to make it responsive to the input of mute and muteon. So that when mute or muteon is input in the textbox it will change the color to red for muteon and green for mute, of a linked id in this case id="text" and "text1". Thanks!
HTML:
<!DOCTYPE html>
<html>
<body>
<p>Write something in the text field to trigger a function.</p>
<input type="text" id="myInput" oninput="myFunction()">
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myInput").value;
document.getElementById("demo").innerHTML = "You wrote: " + x;
}
</script>
</body>
</html>
Wanted linked HTML:
<h1 class="l1-txt1 txt-center p-t-0 p-b-10">
<p id="text1" style="color:white; font-weight: 600"></p>
</h1>
<h1 class="l1-txt1 txt-center p-t-0 p-b-60">
<p id="text" style="color:crimson; font-weight: 600"></p>
</h1>