I have a web application which has elements of type 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 which I need to set these inputs to FALSE
and simulate a MOUSEUP
so that my application performs an action based on it. Basically I used:
$("input[type=checkbox]").prop("checked", false);
$("input").mouseup();
What 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 this returns me this error in console :
off-proc-rec.js: 29 Uncaught TypeError: $ (...) [i] .mouseup is not a function
I've also tried using:
setTimeout($("input").eq(i).mouseup(), 100);
And I got this error:
VM811: 1 Uncaught SyntaxError: Unexpected identifier
Does anyone have any ideas on how to do this?