1
I have a list with a mousedown
within each <li></li>
and I need to put a checkbox
within that li
tbm only that the checkbox
can’t have the mousedown
.
Is there any way to do it?
<li class="list-group-item" onmousedown="modalCartao(1)">
<input style="float: right;" type="checkbox" id="checkbox">
</li>
And how would it be to pass a parameter inside the li mousedown? Because I’m there in fashionCartao(1), this 1 is an example of an id that I pull to open my modal from that reigstro
– mer.guilherme.uem
I also wanted to know a little bit about this li > input. It is possible to explain to me briefly how this works?
– mer.guilherme.uem
yes, this selector selects "within all elements LI all INPUT > nested below it", ie selects the elements
<li><input>
. If your inputs have a class, you can directly select from it– Ricardo Pontual
And another question like that parameter step to ->$("li"). mousedown(Function() { }
– mer.guilherme.uem
can pass the event, or the object itself with
this
$("li").mousedown(function(evento)
, but can do as in your example, with `onmousedown="modalCartao(1)"– Ricardo Pontual
Oh it worked, thank you very much, one last question, because (li > input) does not cancel the event of the checkbox (of selecting the checkbox) and only cancels the of the <li>?
– mer.guilherme.uem