title: Disable jQuery event if Textbox is in focus
body: <p>I want to disable the jQuery event if a Text box is in focus. I am using following code. If a user is entering any text in text field then if by change the cursor moves to the image then it will reset the text in text field to the value shoot by event. I don't want to the event to execute if text field is in focus.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;style&gt;span {display:none;}&lt;/style&gt;
    &lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;input type="text" id="team" /&gt; 
  
  &lt;script&gt;
  $("input").focusin(function() {
  
      document.getElementById("team").value = "I am in Focus Dont shoot events PLZ";
  
      }
  
  );
  
  $(document).ready(function() {
      $("img").mouseover(function(event) {
          if(event.target.name != '')
              {   
  
          document.getElementById("team").value = event.target.name;
  
  
              }
  
          //alert(event.target.name);
      });
  });
  &lt;/script&gt;
  
  &lt;img src="http://1.bp.blogspot.com/-bVD6mGlH_ik/TnHV75bw9KI/AAAAAAAAB84/1hJU7WJuU8k/s400/fewr.jpg" name="I" /&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>I have already tried following function</strong></p>
  
  <pre><code>$("input").focusin(function() {
          document.getElementById("team").value = "I am in Focus Dont shoot events PLZ";
          });
  </code></pre>
  
  <p>Now I am using below code but still not working. Please help me. </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;img src="http://1.bp.blogspot.com/-bVD6mGlH_ik/TnHV75bw9KI/AAAAAAAAB84/1hJU7WJuU8k/s400/fewr.jpg" name="Ihhhhhhhhhhhhhhh" id="myimage" /&gt;
  &lt;input id="theone"&gt;
  
  &lt;input type="image" src="http://www.clker.com/cliparts/e/2/a/d/1206574733930851359Ryan_Taylor_Green_Tick.svg.thumb.png" id="bind"&gt;
  &lt;input type="image" src="http://www.clker.com/cliparts/4/3/1/f/1195436930767206781not_ok_mark_h_kon_l_vdal_01.svg.thumb.png" id="unbind"&gt;
  
  
  
  
  
  &lt;script&gt;
  
    $("#unbind").click(function(event) {
    $("img").off();
    alert("off");
    });
  
  
  
  
    $("#bind").click(function(event) {
     $("img").on();
     alert("on");
    });
  
  
    $("img").mouseover(function(event) {
      if(event.target.name != '')
          {
           document.getElementById("theone").value = "done";
          }
      //alert(event.target.name);
  });
  
  
  
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>