show other input text if dropdown “other” selected

$(function() {
    $("#dropdown").change(function() {
        var val = $(this).val();
        if(val == 'other') {
            $('input[name="other"]').show();
        } else {
            $('input[name="other"]').hide();
        }
    }).change();
});