console
function count(){
var a=parseInt(document.getElementById("no1").value);
var b=parseInt(document.getElementById("no2").value);
var c;
if(a == 0 || b == 0)
{
c = a || b
}
else{
while (b != 0) {
c = a ^ b;
b = (a & b) << 1;
a = c;
}
c=a
}
document.getElementById("end").value=c.toString(2);
}
<body>
<div class="top" style="height:70px;border-bottom:1px solid #ddd;">
<img class="logoIndex" height="60" src="https://www.zenitour.com/img/logoIndex.png" style="margin-left:10px;margin-top:5px;">
</div>
<div class="content" style="text-align:center;margin-top:50px;height: 78%;">
<h2>二进制加法运算</h2>
<input type='text' id='no1' placeholder='请输入数字'/>
<select id='select'>
<option value='+'>+</option>
</select>
<input type='text' id='no2' placeholder='请输入数字'/>
<input type='button' value=' = ' onclick="count()"/>
<input type='text' id='end' />
</div>
<div id="bottom" style="text-align:center;border-top:1px solid #ddd;">
<span class="centerspan" style="font-size:10px">Copyright © 2017 Zenitour lnc All Rights Reserved 版权所有-哲途教育 渝ICP备13002955号-2</span>
</div>
</body>
html,body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}