When I click on a button, a JavaScript function is launched to create a progress bar.
<asp:Button ID="btn_tel" runat="server" CausesValidation="False" OnClick="btn_telefono" Text="Check" CssClass="button" OnClientClick="move()" /></div>
The function move() is as follows:
<script type="text/javascript">
function move() {
setTimeout(function () {
var elem = document.getElementById("myBar");
elem.style.color = "White";
var width = 0;
var temp= "<%=intervallo%>";
var id = setInterval(frame, temp);
function frame() {
if (width >= 100) {
clearInterval(id);
} else {
width++;
elem.style.width = width + '%';
elem.innerHTML = width * 1 + '%';
}
}
}, 0)
}
</script>
Within the code, the variable "intervallo" can be set.
Although the code is functional, I am trying to pass the variable "intervallo" when the button is clicked.
I have attempted various methods without success. Any ideas would be greatly appreciated.
Thank you