I'm trying to make the h1's font reacting so that it's font color is always the opposite of the background. I've checked everything and have no idea what's wrong. Any help?
var oldName;
var open;
function changeImage(name) {
var text = document.getElementById('demo');
if (name == oldName && open) {
text.innerHTML = "<img src=\"blank.jpg\"alt=\"blank\"height=\"256\">"
open = false;
} else {
text.innerHTML = "<img height=\"256\" src=" + name + ">"
open = true;
}
oldName = name;
}
.rev {
mix-blend-mode: difference;
}
body {
background-image: url("colorful.jpg");
}
span {
font-size: 20px;
}
.inside {
font-size: 30px;
}
button {
margin: 0 auto;
width: 400px;
font-family: 'Roboto', sans-serif;
font-size: 17px;
}
p {
font-size: 20;
}
#linkki {
width: 76px;
font-size: 14px;
background-color: white;
}
<center>
<br />
<div class="rev">
<h1>Kysymys</h1>
<div>
<br><br>
<div id="demo">
<img src="blank.png">
</div>
<br><br><br>
<button onclick="changeImage('wrong.png'); this.onclick=null;">
A) Tuntitehtävät, joita hyädynnän omassa kyselyssä ja extratehtävät, jos ehdin.
</button>
<br />
<br />
<button onclick="changeImage('wrong2.png'); this.onclick=null;">
B) Tuntitehtävät.
</button>
<br />
<br />
<button onclick="changeImage('correct.png'); this.onclick=null;">
C) Tuntitehtävät ja oma kysely.
</button>
<br>
<br>
<br>
<div id="myDIV">
<button id="linkki"><a id="linkki" href="kys2.html">Seuraava</a></button>
</div>
</center>
The h1 shows as black. I want it to be the OPPOSITE of the background.