title: How to check input box value is empty when adding value with jquery
body: <p>I have used following jquery to add value to my input box,</p>
  
  <pre><code>$('#btn').click(function(){
      $('#name').val('some text');
  });
  </code></pre>
  
  <p>Now i need to check and show clear button if text added to input. I have tried following code. But it's need to click on input box to work.</p>
  
  <pre><code>$('#name').blur(function(){
         if ($(this).val()) {
            $(".input-clear").show();
         }
         else {
            $(".input-clear").hide();
         }
      });
  });
  </code></pre>
  
  <p>How can i show the button if text added to input box correctly?</p>