JQuery--beautiful ternary operation combined with jQ selector code

    $(function($) {
        $("input[name='timeset']").bind('click', function() {
            $(this).val() == 'customize' ?  $('#showdata').show() : $('#showdata').hide();
            $(this).val() == 'customize_day' ?  $('#showdata_day').show() : $('#showdata_day').hide();
        });
    });

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325317916&siteId=291194637