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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:14:20+00:00 2026-05-26T00:14:20+00:00

So using jQuery I was able to figure out how to change the value

  • 0

So using jQuery I was able to figure out how to change the value of HTML in a span on change with a selection drop down, but it’s a bit hacky. Here’s the code: http://jsfiddle.net/flinx777/ZMjun/

Currently I’m grabbing the class from the selection chosen and replacing the text in the span with the class value. Instead I’d prefer to define the span HTML (define the price of the product here) and when someone chooses from the selections, it either adds or subtracts from the price. So for example I’m trying to make the selection HTML like this:

<select id="price_change" name="buckle options">
<option value="" class="">Please select</option>
<option value="Stainless steel" class="">Stainless Steel</option>
<option value="Titanium" class="+20">Titanium</option>
<option value="No Buckle" class="-10">No Buckle</option>
</select>

This way I can define in the class in the selection options to either add or subtract from the product price (which is in the span) as opposed to the current way I’m doing it of having to manually do the math in the selection as I’m doing now.

Thanks!

  • 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-05-26T00:14:20+00:00Added an answer on May 26, 2026 at 12:14 am

    You can try something like this:

    http://jsfiddle.net/Fft7G/

    but in my opinion, it is stange to set price in class

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

Sidebar

Related Questions

Using jQuery 1.2.x and jQuery UI 1.5.x, one was able to trigger dragging manually
Using jQuery UI 1.8rc3 combined with the new jquery.effects.fade.js code, I've been able to
I'm trying to be able to place the error message when using jQuery validation
So I am using a jquery plug in that allows me to change the
This should be really simple, but I can't seem to figure out what to
I haven't been able to figure this out despite hours of messing around, hopefully
I am using jquery to slide up an down a div. For some reason
I'm using jQuery to access Yahoo's Geolocation APIs. Even though I am able to
I'm trying to make a mobile application using jQuery Mobile and Phonegap. But first
Using jQuery I want to be able to click an element which will also

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.