Reputation: 3048
Suppose I have following selector:
var slots = $('.clinic-branch-2.doctor-has-specialty-3').parent().siblings();
which gives me this result:
[div.col-xs-3.col-sm-3.col-md-2, div.col-xs-4.col-sm-4.col-md-4.slots-go-here, prevObject: m.fn.init[1], context: document]
What I need is to select .slots-go-here
element.
I tried to access it with [1]
index, however it returns raw HTML. Later I need to call .html(someHtmlString)
on my selection. How can I do that?
Upvotes: 0
Views: 156
Reputation: 83
Yo can add class selector to siblings():
var slots = $('.clinic-branch-2.doctor-has-specialty-3').parent().siblings('.slots-go-here');
Upvotes: 1
Reputation: 133403
You can pass selector to .siblings()
method
var slots = $('.clinic-branch-2.doctor-has-specialty-3').parent().siblings('.slots-go-here');
slots.html('Do Something')
Upvotes: 1