나는 진행 막대를 만들었으며 지금은 진도 값을 <h1>
태그에 추가하고 있습니다. 내가 성취하고자하는 것은 이전 가치를 새로운 가치로 대체하는 것입니다. 값이나 비슷한 것을 업데이트하는 데 사용할 수있는 예약어가 있는지 확실하지 않습니다. 올바른 방향으로 어떤 도움이나 강요라도 크게 감사 할 것입니다.문자열의 값을 변경합니다.
감사합니다.
이것은 내가 지금까지 무엇을 가지고 :
const button = document.getElementById("btn");
const bar = document.getElementById("progress-bar");
const heading = document.getElementById("visual-progress");
button.addEventListener('click', function(){
if(bar.value >= 100) {
bar.value=100;
} else {
bar.value+=25;
}
document.getElementById("visual-progress").append(bar.value);
});
body {
max-width: 1200px;
margin: 0 auto;
padding: 10px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
margin-top: 3em;
}
progress {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
width: 100%;
height: 20px;
-webkit-transition: all 5s;
transition: all 5s;
}
progress::-webkit-progress-bar {
background-color: #ccc;
width: 100%;
}
progress::-webkit-progress-value {
background-color: orange !important;
}
button {
margin-top: 2em;
background: black;
color: white;
border: none;
padding: .5em 2em;
}
button:hover {
background: #1a1a1a;
}
.hide {
display: none;
}
<body>
<h2 id='visual-progress'>Quiz Progress</h2>
<progress id='progress-bar' max='100' value='0'></progress>
<button id='btn'>Next</button>
</body>
의 "진행률 표시 줄"텍스트를 바꾸는 대신 이유가없는 추가 변수)? –
그는 "비주얼 진행"텍스트를 변경하기를 망설였습니다. 그것이 요구 사항을 이해하는 방법이며, 내가 옳았던 것처럼 보입니다. 이것도 그의 발췌문에서 ... – dhilt