jQuery Form How to - Create fadeIn effect for input box








Question

We would like to know how to create fadeIn effect for input box.

Answer


<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.7.1.js'></script>
<script type='text/javascript'>
$(window).load(function(){<!--from   www. j  a v  a 2 s . co m-->
    $('#aaa').hide().fadeIn('2000');
    $('#bbb').hide().fadeIn(2000)
});
</script>
</head>
<body>
  <input id="aaa" value="fade me in with string" />
  <input id="bbb" value="fade me in with number" />
</body>
</html>

The code above is rendered as follows: