Home  >  Article  >  Backend Development  >  PHP echo了一个旋钮,但是触发不了click事件

PHP echo了一个旋钮,但是触发不了click事件

WBOY
WBOYOriginal
2016-06-13 12:45:52991browse

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 />

PHP 按钮 click
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn