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类中的内容,并在单击“查看详细信息”按钮时显示类的内容。