PHPecho has a button but cannot trigger the click event & lt ;? Php & nbsp; echo & nbsp; '& lt; input & nbsp; name = "minus" & nbsp; type = "button" & nbsp; value = "-" & nbsp; onclick = "num_minus (" PHP echo has a button, but cannot trigger the click event
Echo'
';
Echo'
';
Echo'
';
?>
Function num_plus (id_num)
{
Document. getElementById (id_num). value ++;
// Document. getElementById ('num'). value = parseInt (document. getElementById ('num'). value) + 1;
// ParseInt (a, B) parses a into a hexadecimal number of B
}
Function num_minus (id_num)
{
If (document. getElementById (id_num). value = 1)
Document. getElementById (id_num). value = 1;
Else
Document. getElementById (id_num). value --;
}
Script
PHP button click to share to: ';... 'data-pics = ''>
------ Solution --------------------
The quotation marks you use are messy ...... Clarify
------ Solution --------------------
echo '
';
echo '
';
echo '
';
Onclick = "num_minus (" xx ");" an error is reported in the browser!