'리셋'버튼을 클릭하면 다른 버튼의 값이 변경됩니다. document.getelementbyid 속성을 사용하려고했지만 작동하지 않는 것 같습니다. 누군가 이것을 구현해야하는 방법을 알고 있습니까?문서 ID로 자바 값 설정
function reset() {
stop();
x.reset();
update();
opnieuw = setTimeout(function(){
document.getElementById("scherm3").style.display = "block";
document.getElementById("scherm2.2").style.visibility = "hidden";
}, 10000);
clearTimeout(timeOut);
clearTimeout(timeOutElse);
document.getElementById("buttontimer").value = "Start";
}
setTimeout(start, 5000);
function toggleTimer(event) {
if (isTimerStarted) {
stop();
event.target.value = 'Start';
timeOut = setTimeout(function(){
document.getElementById("scherm4").style.visibility = "visible";
document.getElementById("scherm2.2").style.visibility = "hidden";
}, 4000)
clearTimeout(opnieuw);
clearTimeout(timeOutElse);
}
else {
start();
event.target.value = 'Stop';
timeOutElse = setTimeout(function(){
document.getElementById("scherm3").style.display = "block";
document.getElementById("scherm2.2").style.visibility = "hidden";
}, 8000)
clearTimeout(timeOut);
clearTimeout(opnieuw);
}
}
및 HTML : 당신은 아마 그냥 단순히 "시작"을함으로써 간단하게 코드를 만들어 별도로, "중지"버튼을, 그냥 보여줄 수
<div id="button1"><input type="button" value="Stop" onclick="toggleTimer(event); clicks5times();" id="buttontimer"></div>
<input type="button" value="Opnieuw" onclick="reset()" class="button2" id="opnieuw">
그리고 html은 무엇입니까? – everton
결코 호출되지 않는 재설정 함수, 정의되지 않은 시작 함수의 setTimeout 및 절대로 호출되지 않는 toggleTimer 함수가 있습니다. 보유하고있는 모든 것을 게시하고 그것이하고 있지 않은 일을 원하는대로 설명하면 유용한 해답을 얻을 수 있습니다. –
@EvertonAgner 내 게시물을 편집합니다! – annaneedshelp