I have s slideToggle function like this
$(document).ready(function(){
$(".widget-content-box").slideUp(); // $(".widget-content-box").hide()
$("#goal1").click(function(){
$(this).parent().next().slideToggle("slow");
});
})
I am executing the click function on an id of #goal1 and would like to have multiple slideToggles, but rather than use #goal1, #goal2, #goal3 etc what can I use? Is it id plus attr? but how would i set that out in the code, or where can I find the resource to find out?
any help appreciated
If you cannot modify your HTML adding classes as already suggested,
you could use the “starts with” selector
^: