Home:ALL Converter>Show Hide div & close with fadein fadeout on focus input

Show Hide div & close with fadein fadeout on focus input

Ask Time:2012-12-19T21:58:36         Author:Nisha Ankit

Json Formatter

Hi i am using this code to show hide div on input focus

here is html please have a look @jsfiddle also

<div id="divone">
    <input class="url_field" />
</div>
<div id="first" class="content">
    First
    <input class="close" type="button" value="X"/>
</div>
<div id="last" class="content">
    Last
    <input class="close" type="button" value="X"/>
</div> 

Javascript snippet:

$(document).ready(function() {
    $(".url_field").focus(function() {
        $(this).next(".content").fadeout('slow').css('display', 'inline');
    });

    $('.url_field').focus(function() {
        $('.content').hide();
        $('#' + this.rel + '').show();
        return false;
    });
    $('.content input.close').click(function() {
        $(this).parent().hide();
    });
});

please help me, its not working

Author:Nisha Ankit,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/13953984/show-hide-div-close-with-fadein-fadeout-on-focus-input
yy