Javascript 使用另一页上的按钮更改值
我正在用html/css/js制作日历。 我有一个index.html,其中包含:Javascript 使用另一页上的按钮更改值,javascript,html,function,button,Javascript,Html,Function,Button,我正在用html/css/js制作日历。 我有一个index.html,其中包含: <html> <head> <title>App calendario</title> <link rel="stylesheet" href="style.css" type="text/css" /> <script src="myfunc.js"></script> </head> <
<html>
<head>
<title>App calendario</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="myfunc.js"></script>
</head>
<body>
<form>
<button class="button-customize" onclick="MyFunction(4)" type="button">4 - 10</button>
</form>
</body>
另一个页面settimana.html是:
<html>
<head>
<title>Settimana</title>
<link rel="stylesheet" href="./style.css" type="text/css" />
<script src="myfunc.js"></script>
</head>
<body>
<form action="#">
<button class="button-customize" type="submit" id="Giorno_1" name="Giorno_1">Giorno 1</button>
</form>
</body>
</html>
问题是页面settimana.html中按钮的值没有改变。为什么?请帮帮我。您需要说出脚本将数据发送到服务器的位置。所以你需要像
<from method="POST" action="target.php">......</form>
在我看来,您需要有一个服务器脚本,它通过PHP中的$\u POST globals使用公式数据。我想使用纯html,您可以发送一封包含表单数据的电子邮件
settimana和index都使用相同的脚本文件,但这并不意味着它们共享同一个脚本文件。它们在内存中都有一个副本,因此一个副本中的更改不会影响另一个副本。您需要在加载数据之前传递所需的任何数据。
<from method="POST" action="target.php">......</form>