2
JQUERY/Javascript
verificaCamposRepetidos(".teste", array1);
verificaCamposRepetidos(".teste1", array2);
HTML:
<p id="parte1">
<span>VALORES de 1 a 3</span><BR/>
<input type="text" class="teste"><BR/>
<input type="text" class="teste"><BR/>
<input type="text" class="teste"><BR/>
</p>
<p id="parte2">
<span>VALORES de 1 a 5</span><BR/>
<input type="text" class="teste1"><BR/>
<input type="text" class="teste1"><BR/>
<input type="text" class="teste1"><BR/>
<input type="text" class="teste1"><BR/>
<input type="text" class="teste1"><BR/>
</p>
the problem is occurring when I will type in the block (#parte1
), he’s talking to type in numbers 1 à 5
and not of 1 à 3
, looks like it only does the validation of the last Function that was added....
(verificaCamposRepetidos(".teste1", array2);
)
$("div"). on("click", "li", Function(){ }); Does the same thing. Events are propagated from the target element to their parents until they reach Document. Thus: $(Document). on("click", "div ul li", Function(){ }); It would also work. or Document.addeventlistener(click, Function(){ });
– Moykn