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 8131053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:57:34+00:00 2026-06-06T08:57:34+00:00

I have a userscript that has to change a whole list of options depending

  • 0

I have a userscript that has to change a whole list of options depending on 1 option in a select. In Opera this script works fine, but not in Chrome (Yes, jQuery is available).

HTML:

<select id="autoConfig-gametype" style="width: 100%;">
    <option value="1" selected="">1. [RECOMMENDED] All latest Game-settings, Paladin, archers, simple tech smithy</option>
    <option value="2">2. No paladin, archers, simple tech system [TWMASTERS Settings]</option>
    <option value="3">3. No paladin, no archers. Packages, 3 lvl tech-system. [CLASSIC]</option>
</select>

<select name="game::tech">
    <option value="0">0: 10 level</option>
    <option value="1">1: 3 level (up to 15)</option>
    <option value="2" selected="selected">2: Simple</option>
</select>

With jQuery I have used attr and prop, but both have no result in Chrome. The select that needs to be manipulated does not change.

jQuery:

$("#autoConfig-gametype").change(function()
{
    var value = $(this).val();

    switch(value)
    {
        case "1":
            // Game > Tech
            $("[name='game::tech'] option").removeProp("selected");
            $("[name='game::tech'] option").removeAttr("selected");
            $("[name='game::tech'] option:eq(0)").attr("selected",true); 
            $("[name='game::tech'] option:eq(0)").prop("selected",true); 
            break;
        case "2":
            // Game > Tech
            $("[name='game::tech'] option").removeProp("selected");
            $("[name='game::tech'] option").removeAttr("selected");
            $("[name='game::tech'] option:eq(1)").attr("selected",true); 
            $("[name='game::tech'] option:eq(1)").prop("selected",true);  
            break;
        case "3":
            // Game > Tech
            $("[name='game::tech'] option").removeProp("selected");
            $("[name='game::tech'] option").removeAttr("selected");
            $("[name='game::tech'] option:eq(2)").attr("selected",true); 
            $("[name='game::tech'] option:eq(2)").prop("selected",true);  
            break;
    }
});

I am kind of stuck here right now, because I am making this script for someone who only uses Chrome.

  • 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-06T08:57:37+00:00Added an answer on June 6, 2026 at 8:57 am

    removeProp and removeAttr were not working, using .prop('property', true/false) works. Please see the fiddle in Chrome.

    Fiddle -> http://jsfiddle.net/6bxew/

    $("#autoConfig-gametype").change(function()
    {
      var value = $(this).val();
    
      switch(value)
      {
        case "1":
            // Game > Tech
            $("[name='game\:\:tech'] option").prop("selected", false); 
            $("[name='game\:\:tech'] option:eq(0)").prop("selected", true);
            break;
        case "2":
            // Game > Tech
            $("[name='game\:\:tech'] option").prop("selected", false);
            $("[name='game\:\:tech'] option:eq(1)").prop("selected",true);  
            break;
        case "3":
            // Game > Tech
            $("[name='game::tech'] option").prop("selected", false);
            $("[name='game::tech'] option:eq(2)").prop("selected",true);  
            break;
      }
    });
    

    ​

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

Sidebar

Related Questions

Let's say I have a greasemonkey-type user script running on a page that has
Have a matrix report now that has Position, Hours and Wages for a location
I have a user script (for chrome and FF) that adds significant functionality to
I have a private script that I'm trying to get to run as a
I have a userscript (read: my Javascript on someone else's site) that allows users
I have a greasemonkey user script with this single line of code... window.close(); but
I have this code // // ==UserScript== // @name test // @description test //
I have a script on GM that I would like to add color to
I have this script for Gmail. It runs inside the canvas_frame iframe. I want
I have a user script that would be much more useful if it could

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.