Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7728859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:49:28+00:00 2026-06-01T05:49:28+00:00

I am using following selector to remove single item in select. jQuery(#stateCity option[value=’Adak, AK,

  • 0

I am using following selector to remove single item in select.

jQuery("#stateCity  option[value='Adak, AK, USA']").remove();

I want a selector that can remove all cities of a state. Like *, AK, USA will remove all cities of Alaska in the combo.

So what regex I should use to do it in one line? Of if I have to loop it. How can I do that.

<select name="stateCity" id="stateCity">
    <option value="Adak, AK, USA">Adak, AK, USA</option>
    <option value="Akhiok, AK, USA">Akhiok, AK, USA</option>
    <option value="Redwood, CA, USA">Redwood, CA, USA</option>
    <option value="AL, USA">AL, USA</option>
</select>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:49:29+00:00Added an answer on June 1, 2026 at 5:49 am

    Try this jQuery("#stateCity option[value$='AK, USA']").remove();

    Demo: http://jsfiddle.net/8cuYM/

    $= selects any element that the value ends with that you specified, in this case AK, USA.

    Read more at http://api.jquery.com/attribute-ends-with-selector/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following snippet to create a select/deselect all checkboxes: http://www.wiseguysonly.com/2010/01/15/select-and-unselect-all-checkboxes-with-jquery/ This is
I'm currently attempting to disable a link using the following jQuery selector: $(a[href$=/sites/abcd/sectors]).removeAttr(href); The
I am using following Jquery selector $(#selectedQuery td input:radio).attr('checked', true); Where selectedQuery is a
I am using following code to remove some specific nodes from xml file..It show
all! I want to create multiple threads in my application. I' using following code
I have the following selector, which works: parent::node()/myNS:expField[myNS:Nam='NAMETOFIND']/myNS:Val What I want is to do
I want to do some action on a thread using the following API, so
hi am using following xml as my customlistview background when am click an item
i am using following code #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000 if ([[UIApplication sharedApplication] respondsToSelector:@selector(beginBackgroundTaskWithExpirationHandler:)]) {
I'm using Codlfusion 9's StructDelete() method to remove a value from a cookie. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.