Basically adding some slider features, and would like to throw the slider under the error CSS class to highlight under certain conditions.
I am programming tooltips to slide along above the handles, and when the error style is added, i want to throw it across all elements, except these handles. The handles are encapsulated in their own <div class="tooltip">
tags, however, when I call the selector to call var div = $(this).find('div:not([class=.tooltip])');
, the child elements of this encapsulating div class have their styles updated when i subsequently call div.addClass("ui-state-error ");
TL;DR: Is there any way to call the not()
selector such that an element, and all its children, are excluded. I know that explicitly listing the child elements is a quick dirty workaround, but is there anything in the JQuery library to accommodate this?
Note that I am purposely avoiding ID tags as this control will eventually make it into an ASP User Control, and I want to avoid conflicting ID tags later on down the line.
Try this :
$(this).find('div:not(.tooltip, .tooltip *)');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With