How to use the click(function) with 'OR'?
Hello.
My action woks like this:
-
$("#my_link_1").click(function(){
if(!$('#hint').attr('checked')){
$("#whatever").removeAttr("disabled");
}
});
$("#my_link_2").click(function(){
if(!$('#hint').attr('checked')){
$("#whatever").removeAttr("disabled");
}
});
$("#my_link_3").click(function(){
if(!$('#hint').attr('checked')){
$("#whatever").removeAttr("disabled");
}
});
But this seems to me not fine because in another case i am able to use 'OR' like this:
-
if( $('#my_link_1').attr('checked') || $('#my_link_2').attr('checked') || $('#my_link_3').attr('checked')){
if(!$('#hint').attr('checked')){
$("#whatever").removeAttr("disabled");
}
}
Is it possible to combine the click(function) (or rather the handler) with 'OR' like this (of course) not working snippet:
-
if( $("#my_link_1").click(function() || $("#my_link_1").click(function() || $("#my_link_1").click(function()){
if(!$('#hint').attr('checked')){
$("#whatever").removeAttr("disabled");
}
}