I'm working on a dynamic html page with JavaScript and I want to run a function automatically without using onclick and I want to execute it with a delay.
I tried setTimeout() but it didn't work as expected.
How can I convert the code below to run function updateSliderValue() automatically with delay but without button?
<!--creating a container for the input box-->
<div><button onclick="updateSliderValue();">Set value</button></div>
the code is:
}
function updateSliderValue() {
slider = widget.getByName("Slider1");
slider.setValue();
}
</script>
</head>
<body>
<div style="clear: both; margin-top: 40px;"></div>
<div class="cell">
<div class="container" style="height: 100px;">
<div class="widget" style="height: 100%;" id="root">
</div>
</div>
</div>
<!--creating a container for the input box-->
<div><button onclick="updateSliderValue();">Set value</button></div>
</body>
</html>
thank you so much for your effort and your time but i don't know where put the code you gave to me.