我知道你不能在html中有真正的變量,但我想知道這是否可能。我搜查了四周,找不到任何明確回答我的問題的東西。希望有人聽到可以指引我正確的方向。這裏就是我的想法:用js函數顯示HTML表單的結果
<!DOCTYPE html>
<html>
<body>
<input type="text" name="test">
<input type="submit" onclick="myFunction(test)">
<script type="text/javascript">
function myFunction(test)
{
alert("Welcome " + test);
}
</script>
</body>
</html>
將這工作或類似的東西? 謝謝,山姆
你想要完成什麼*確切* – Matt 2012-08-16 15:22:01
要回答你的問題,不,那不行,因爲'test'沒有任何價值。 – Matt 2012-08-16 15:22:55
提醒文本輸入的值,抱歉不清楚 – 2012-08-16 15:23:02