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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:01:59+00:00 2026-06-03T07:01:59+00:00

I need to run a jquery function if a certain dropdown option is selected.

  • 0

I need to run a jquery function if a certain dropdown option is selected.

<select name=dropdown size=1>
    <option value=1>option 1</option>
    <option value=2>option 2</option>
</select>

I have the commands in the function ready, Im just not sure on how to make it so if option 2 is currently active in the dropdown, then run the function.

(dropdown doesnt have a submit button, i want it ran when the user highlights the option)

  • 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-03T07:02:00+00:00Added an answer on June 3, 2026 at 7:02 am

    Try this demo http://jsfiddle.net/JGp9e/

    This will help, have a nice one!

    code

    $('select[name="dropdown"]').change(function(){
    
        if ($(this).val() == "2"){
            alert("call the do something function on option 2");
         }        
    });​
    

    HTML

    <select name="dropdown" size=1>
        <option value="1">option 1</option>
        <option value="2">option 2</option>
    </select>​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following function in Javascript: $find('mainWindow').repaint(); I need to run that inside
I need a jquery to function to run on page load. I could not
I need help getting a Grease Monkey with JQuery Script to run on a
I need to run a script and have access to the default stdin (terminal
We want to know if it is possible to have a function using jQuery
Here's my dilemma. I have 2 animations that need to run sequentially. The first
I have the following JQuery code $(#classparent).click(function () { $(.classsubitems).slideToggle('slow', function () { });
I need to run two versions of jQuery. I've tried aliasing j to jQuery.
I need to run some code after my jQuery UI accordion initializes. According to
I have a jQuery function that runs when a box is clicked that affects

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.