It appears that you have three spans in your code, with two containing letters of the alphabet and one being empty.
<span id="span1">b</span>
<span id="span2">b</span>
<span id="span3"></span>
Your goal seems to be comparing the content of the first two spans. If they match, the third span will display 1; otherwise, it will show 0:
if(document.getElementById('span1').innerHTML == document.getElementById('span2').innerHTML) {
document.getElementById('span3').innerHTML = '1';
}
else{
document.getElementById('span3').innerHTML = '0';
}
Check out the DEMO here