1
I have a web application which I have elements like input.
<input class="switch-input" name="0" type="checkbox" />
<input class="switch-input" name="1" type="checkbox" />
<input class="switch-input" name="2" type="checkbox" />
<input class="switch-input" name="3" type="checkbox" />
And I have a Javascript code that I need to set these inputs for FALSE
and simulate a MOUSEUP
for my application to perform an action based on this. Basically used:
$("input[type=checkbox]").prop("checked", false);
$("input").mouseup();
Which worked very well initially, but in this case runs everything together and now I need a little delay. I tried to do:
$("input[type=checkbox]").prop("checked", false);
for(i=0;i < $("input").length; i++)
{
setTimeout($("input")[i].mouseup(), 100);
}
But it returns me this error in console:
off-proc-rec.js:29 Uncaught Typeerror: $(...)[i]. mouseup is not a Function
I also tried using:
setTimeout($("input").eq(i).mouseup(), 100);
And I got this mistake:
VM811:1 Uncaught Syntaxerror: Unexpected Identifier
Does anyone have any idea how to do that?
Test as follows: https://jsfiddle.net/LkL4ne6a/
– Sergio