JQuery Disable And Enable div by an INPUT field

<html> 
<head>                                                                  
 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>      

<script>
$().ready(function() {
    
    $('#email').hide();    
    
    $('#myText').keyup(function() {
        var val = $('[name=myText]').val();
        if(val == ''){
            $('#email').hide();  
        }else{
            $('#email').show();  
        }  
    });    
    
});
</script>
</head>

<body>
    <form>
         Type something: 
          <input type='text' id='myText' name='myText'/>
          <div id="email">Show ME!!</div> 
    </form>
</body>
</html>










Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

0 comments: on "JQuery Disable And Enable div by an INPUT field"

:) ) ;) ) ;;) :D ;) :p :( ( :) :( :X =(( :-o :-/ :-* :| 8-} :) ] ~x( :-t b-( :-L x( =))
Post a Comment