Jquery getting a child class of a selector retrieved using .prev
back = $("#contactus_"+id).prev();
I'm probably asking a simple question, but how do I get at .up_btn class from the id above?
no开发者_开发知识库rmally to target this class i would do $("#contactus_"+id+" .up_btn") however in this instance I can't place the class name in there like that since I want the previous sibling's child.
Thanks
If you mean .up_btn
is found in that previous sibling,
$('#contactus_' + id).prev().find('.up_btn');
To use it with the back
variable,
var back = $('#contactus_' + id).prev();
var btn = back.find('.up_btn');
精彩评论