jQuery - .not() isn't working with .text() -
I have a dropdown that looks like this:
& lt; Choose Name = "cc_dropdown [0]" id = "CC-Dropdown-0" & gt; & Lt; Option value = "" & gt; Choose a card & lt; / Option & gt; & Lt; Option value = "0" & gt; ********** 1111 & lt; / Options & gt; & Lt; Option value = "1" selected = "selected" & gt; ********** 0005 & lt; / Options & gt; & Lt; Option value = "- 1" & gt; A new card & lt; / Options & gt; & Lt; / Select & gt; I have a div that looks like this:
& lt; Div id = "select-cc-dropdown-0" & gt; & Lt; Div class = "selectbox" tabindex = "0" & gt; & Lt; Div class = "sbcontent" & gt; ********** 0005 & lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; I need to get a collection of all the options in the dropdown whose text does not match the text in the sbContent div. This is what I've tried:
var tmp = $ ('# select-cc-dropdown-0 .select box .sbContent'). Text (); $ ('#cc-dropdown-0 Option') Text (). Not (tmp); var tmp returns the expected text (in this case, * *** * 0005 ). But when I try to do the string .text () after .not () , I get an error (TypeError: $ (...). (...) .not is not a function.) How do I string together these two bits?
Of course this does not work, gives a string, not a jQuery object
Comments
Post a Comment