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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:51:37+00:00 2026-06-12T03:51:37+00:00

Simply, I want to change the css display state of a div based on

  • 0

Simply, I want to change the css display state of a div based on what you select on a drop down. That means, when I select an item on my drop down, it changes a div’s css display property from none to block.

My CSS

<style>
  .lp_claims, .gap_claims, .home_claims, .motor_claims{ display:none;}
</style>

HTML

<select name="claimsform">
<option value="lp_claims"> Loan Protection </option>
 <option value="gap_claims"> GAP or Cash Assist </option>
 <option value="home_claims"> Home </option>
 <option value="land_claims"> Landlords </option>
<option value="motor_claims"> Car </option>
</select> 

<div class="lp_claims">
<p> <strong>Loan </strong><br>
Contact  us  </p>
</div>

<div class="gap_claims">
<p> <strong>GAP or Cash Assist </strong><br>
Contact  us  </p></div>

<div class="home_claims">
<p><strong>Home </strong><br>
Contact  us  .</p>
</div>

<div class="motor_claims">
<p><strong>Motor</strong><br>
Contact  us .</p>
</div>

and Jquery

<script type="text/javascript">
$(document).ready(function(){
$('select').on('change', function(){
var val = $(this).val();
$('div').hide();
$('.' + val).css('display','block'); }).change();
});
</script>

Here’s the fiddle : http://jsfiddle.net/En4Ka/

OK NOW EVERYTHING WORKS FINE. AND MY QUESTION IS : Why isnt this working on my HTML file : http://fitfixtraining.com.au/test/index.html

  • 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-12T03:51:38+00:00Added an answer on June 12, 2026 at 3:51 am

    Because (as ahren [+1] said) you have an illegal character in your code, look at your console’s errors.

    It usually happens when you copypasta code from jsfiddle.

    Here’s a screenshot from Notepad++ where I highlight it for you:

    enter image description here

    edit: Just coded a quick JS to get rid of those pesky invisible white spaces, you can try it here.

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

Sidebar

Related Questions

I simply want to change a variable of an object from another class. I
I simply want to show off a model in a table that is paginated
I simply want to generate a class with attributes that comes from a Database
I have several sql queries that I simply want to fire at the database.
I'm sure I'm just missing something simple, but I want to change the CSS
I want to simply change the colors and define the edges of a multiple
I have some code that is a simple div with a css stylesheet that
CSS & html id0 is the class for the div that's got background as
I simply want to change the color of the textarea in disqus where one
I'm not sure why my event isn't firing? I simply want to change the

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.