Hi,
I have a range of items in an HTML drop-down menu that I need to find with jQuery so I can then hide them [using .css('display', 'none')
].
They are (in this example) all the ones between <option>---- Articles</option>
and <option>---- Jargon Buster</option
> except for the first six items in this range!
Other than these first six, the number and text of all the other options within this range will vary (apart from from the leading ------
).
I'm thinking maybe I can utilse the selectors $("#edit-menu-parent option:contains('---- Articles')"
and $("#edit-menu-parent option:contains('---- Jargon Buster')"
somehow, but I'm not sure how these can be used to get the items in between them.
Any ideas?
<select id="edit-menu-parent" class="form-select menu-title-select" name="menu[parent]">
<option>---- Clients</option>
<option>---- Testimonials</option>
<option>-- Resources</option>
<option>---- Articles</option>
<option>------ Accessibilty Articles</option>
<option>------ Usability Articles</option>
<option>------ Charities Articles</option>
<option>------ Public Sector Articles</option>
<option>------ Web Development Articles</option>
<option>------ Social Media Articles</option>
<option>------ Are Your Online Forms</option>
<option>------ Benefits of Web Standards</option>
<option>------ Benefits of web accessibility</option>
<option>------ Increase Donations to Your</option>
<option>------ Need More Web Traffic? Get</option>
<option>------ The Secret to Successful ALT</option>
<option>------ Top 10 Email Marketing Tips</option>
<option>------ What PAS 78 Means for Your</option>
<option>------ What is Web Accessibility?</option>
<option>---- Jargon Buster</option>
<option>---- Web Design Tips</option>
<option>------ Colour blindness</option>
<option>------ Create a custom 404 page</option>
<option>------ Download time and usability</option>
<option>------ Full stop to the end of alt</option>
<option>------ Javascript and navigation</option>
<option>---- Your Industry News</option>
</select>