<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript">
function firstFunc() {
var a = document.getElementById('int1').value;
var b = document.getElementById('int2').value;
var c = document.getElementById('jia').checked;
var d = document.getElementById('jian').checked;
var e = document.getElementById('cheng').checked;
var f = document.getElementById('chu').checked;
var ul = document.querySelector('ul');
var li = document.createElement('li');
if (c == true) {
g = a*1 + b*1 ;
li.innerText = g;
} else if (d == true) {
g = a - b;
li.innerText = g;
} else if (e == true) {
g = a * b;
li.innerText = g;
} else if (f == true) {
g = a / b;
li.innerText = g;
}
ul.insertBefore(li, ul.children[0]);
}
</script>
</head>
<body>
<input type="text" name="" id="int1" value="" placeholder="第一位数" />
<input type="text" name="" id="int2" value="" placeholder="第二位数" />
<input type="radio" name="suan" id="jia" value="" />+
<input type="radio" name="suan" id="jian" value="" />-
<input type="radio" name="suan" id="cheng" value="" />*
<input type="radio" name="suan" id="chu" value="" />/
<button type="button" onclick="firstFunc()">计算</button>
<ul>
</ul>
</body>
</html>