0
I’m trying to use jQuery to do something like:
if($('#id').click) {
//Eu sei que quando este elemento
//for clicado ele vai fazer algo aqui, mas, eu queria em um
//outro momento fora da função saber se foi clicado ou não
}
if($('#id2').click) {
}
EX:
if($('#id').***clicked*** {
}
I need to test which of the two was clicked because I will call in the same HTML. For example:
$('foto)'.click(function(){
if($('#id').clicked){
function1();
}
if($('#id2').clicked){
function2();
}
}
I don’t understand why you need the
if
andelse
? if the guy doesn’t click automatically would be theelse
and if the person click would be theif
, could explain better?– Rafael Augusto
Hello, what is the intention of the second click? Can not do all the necessary functions after clicking in one place?
– David Alves
I’ll edit the question to explain it better.
– user129243