jeudi 2 juin 2016

How to check if a textbox is clicked on

I have a keyup function on my script and when I type into one of my text boxes it triggers my hotkey which hides the text box so it makes it impossible to type in it. Please help.

$(document).keyup(function(e){
  if(e.which == 67){
       if($('#main').css('opacity') == 0) {
    $("#cHideChat").click();
      }
  }
});

I want something like this but I don't know the right word to put here.

$(document).keyup(function(e){
      if(e.which == 67){
       if($("#chat-input").is("clickedOn")){
         }
       else{
         if($('#main').css('opacity') == 0) {
          $("#cHideChat").click();
      }
    }
  }
});

Aucun commentaire:

Enregistrer un commentaire