<script language=javascript>
function hello()
{
alert("hello");
}
</script>
<form action = "$_PHP_SELF">
<input type = "button" name = "button1" value = " button " onclick = "hello()" >
</form>提示为了防止出现错误最好不要将每个button的名称与值写成相同的名字
function hello()
{
alert("hello");
}
</script>
<form action = "$_PHP_SELF">
<input type = "button" name = "button1" value = " button " onclick = "hello()" >
</form>提示为了防止出现错误最好不要将每个button的名称与值写成相同的名字
function hello()
{
echo "hello";
}
<form action = "">
<input type = "button" name = "button" value = "button" onclick = "hello()" >
</form>
为什么按下button时不能实现hello函数
**********************************************************************
<?php
function hello()
{
echo "false";
}
<form action = "">
<input type = "button" name = "button" value = "button" onclick = "<? hello();?>" >
</form>
为什么按下button时不能实现hello函数
function hello()
{
echo "hello";
}
<form action = "">
<input type = "button" name = "button" value = "button" onclick = "hello()" >
</form>
为什么按下button时不能实现hello函数
**********************************************************************
<?php
function hello()
{
echo "false";
}
<form action = "">
<input type = "button" name = "button" value = "button" onclick = "<? hello();?>" >
</form>
要用 onclick = "<? hello();?>" 原理跟 <? echo "true";?>一样php函数就要在php语言块中调用
我建议楼主先去搞清楚web程序的原理,这样对你以后写web程序都很有帮助的