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

WBOY
Release: 2016-06-13 12:45:52
Original
1013 people have browsed it

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 />
Copy after login
PHP 按钮 click

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!