title: How to get input has focus or not using jquery
body: <p>How to get input tag of html has focus or not using jquery</p>
  
  <p>keydown event will work for form if input,image etc. tag has focus. but it will not work it focus is on form but not on any tags like input,image etc.
  How can I solve this.
  Please help
  Thanks in advance</p>
  
  <p><code>$('#title').focusout(function()</code> 
  <code>{</code>
  <code>if($(document.activeElement).is(":focus"))</code>
  <code>{</code>
  <code>alert('focus');</code>
  <code>}</code>
  <code>else</code>
  <code>{</code>
  <code>alert('not focus');</code>
  <code>}</code>
  <code>});</code>
  // this will not work</p>