<body><input type="button" value="1" onclick="one()" id="a1"><input type="button" value="2" onclick="two()" id="a2"><input type="button" value="-" onclick="add()" id="a3" ><input type="button" value="=" onclick="dy()" ><input type="text" value="" id="a4" ></body><script>var a_4 = ""function one(){? ?var a_1 = document.getElementById("a1").value? ? ? ? ? ? ? }function two(){? ?var a_2 = document.getElementById("a2").value? ? ? ? ? ? ? }function add(){? ? var a_3 = document.getElementById("a3").value? ? ? ? ? ? }function dy(){? ? ? ?document.getElementById("a4").value =?a_4? ? ? ? ? ? }</script>
我想實(shí)現(xiàn)的效果是1-2=結(jié)果 或者 2-1=結(jié)果 為什么下面代碼實(shí)現(xiàn)不了?
陽火鍋
2017-12-21 17:07:53