Reputation: 307
Bellow example working well but in this example I want to select "#btn-create" as "this" to hide it. Means when I click on "btn-create" button it should hide with given ID and Class.
$("#btn-create").click(function(){
$("#btn-create, #add-goal-form, .custom-file-upload").hide();
$(".add-goal-feedback, #btn-complete").show();
});
Upvotes: 0
Views: 45
Reputation: 1758
try using add()
function of jquery which will create a group of elements and then execute .hide()
functionality on that group -
$(this).add(" #add-goal-form, .custom-file-upload").hide();
Upvotes: 3