首页 > 解决方案 > 如何为调查保存号码?

问题描述

我对 html 和 js 非常陌生,搜索并没有给我答案。我的问题是我想通过单击一个按钮来更改变量+1,以便它不会在重新加载时返回,我希望这个数字可以显示在另一个站点上。我的测试:更改数字的按钮:回答 1out of 4

let A1 = '1';
function Antwort1(){
var A1 = 'A1' + 1
}
function resultA1(){
document.write(A1)  
}
ul{font-family: arial;}
span, table, ul, p, p3, p2, h3, h1, h2, a, button{text-align: center; margin:auto ; font-family: arial; :}
p{margin-top: 0; margin-bottom: 0;}
h1{text-decoration: underline; font-size: 4em ; background-color: lightblue}
h3{ font-size: 2em;}
p{font-size: 24px}
p2{font-size: 18px}
body{background: white}
button{font-size: 27px ; float: center ; cursor: pointer ; background-color: lightblue ; color : black ; border: solid white}
button:hover {font-size: 27px ; float: center ; cursor: pointer ; background-color: white ; color : lightblue ; border: solid lightblue}
p3{text-align: center}
.container{margin: auto; border: none ; display:grid; align-items:center  ;justify-contend: center}
<html>

<script src="../index.js">
</script>
<link rel="stylesheet" href="..\formate.css" >
<link rel="script" href="../index.js"
    <head>
    </head>
    <body>
    <h1>Frage 1</h1>
    <h2>wie oft hast du online Unterricht, anstatt Aufgaben?</h2>
<p>
<button id="A1" onclick="Antwort1()">nie</button>

</p>
    </body>
</html>

标签: javascripthtml

解决方案


推荐阅读