PHP echo了一个按钮,但是触发不了click事件
<br /> <?php <br /> echo '<input name="minus" type="button" value="-" onclick="num_minus("xx");"/>';<br /> echo '<input name="num" id="xx" type="text" width="16" value="1"'.'>';<br /> echo '<input name="plus" type="button" value="+" onclick="num_plus("xx");"/>';<br /> ?><br /> <script type="text/javascript"><br /> function num_plus(id_num)<br /> {<br /> document.getElementById(id_num).value++;<br /> //document.getElementById('num').value=parseInt(document.getElementById('num').value)+1;<br /> //parseInt(a,b)将a解析成b进制数<br /> }<br /> function num_minus(id_num)<br /> {<br /> if(document.getElementById(id_num).value==1)<br /> document.getElementById(id_num).value=1;<br /> else<br /> document.getElementById(id_num).value--;<br /> }<br /> </script><br /> <br />