Display hidden textfield


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. //If div isn't empty, display div2.
  2. $('#div').keyup(function () {
  3. if ($(this).val()) {
  4. $("#div2:hidden").show();
  5. $('#div2').addClass('inputclass pageRequired');
  6. } else {
  7. $('label[for=test]').hide();
  8. $('#div2:visible').removeClass('inputclass pageRequired');
  9. $("#div2:visible").hide()
  10. }
  11. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.