Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 这个函数在jQuery中做什么?_Javascript_Jquery - Fatal编程技术网

Javascript 这个函数在jQuery中做什么?

Javascript 这个函数在jQuery中做什么?,javascript,jquery,Javascript,Jquery,实际上,我正试图将这个jQuery代码应用到我的html代码中,但没有得到所需的输出 jQuery(document).ready(function() { jQuery(".careers_sec input#apply_now").click(function() { var Apply_for_button = jQuery(this).attr("rel"); jQuery('#InterestedIn').val(apply_for_btn);

实际上,我正试图将这个
jQuery
代码应用到我的html代码中,但没有得到所需的输出

jQuery(document).ready(function() {
    jQuery(".careers_sec input#apply_now").click(function() {
        var Apply_for_button = jQuery(this).attr("rel");
        jQuery('#InterestedIn').val(apply_for_btn);
    });
    jQuery("#view_details").click(function() {
        var id = $(this).attr('rel');
        console.log(id);
        $(this).hide();
        $('#' + id).find('#apply_now').show();
        $('#' + id).find('.upButton').show();
        $('#' + id).find('.job_desc').slideDown(500);
    });
    jQuery(".upButton").click(function() {
        var id = $(this).attr('rel');
        console.log(id);
        $(this).hide();
        $('#' + id).find('#apply_now').hide();
        $('#' + id).find('#view_details').show();
        $('#' + id).find('.job_desc').slideUp(500);
    });
});

您想知道它的功能是什么?期望的输出是什么,您得到的是什么?期望的输出是什么?您是否有多个元素具有
id=“apply\u now”
?那不行,ID必须是唯一的。您应该改用类。我想在单击“立即应用”按钮时隐藏job_desc类中的内容,并在单击“查看详细信息”按钮时显示类的内容。