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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:39:33+00:00 2026-06-12T09:39:33+00:00

I have a dropdown box with 4 options. Then, I have 4 div containers

  • 0

I have a dropdown box with 4 options.

Then, I have 4 div containers which I have made invisible using style="display:none".

I want that on selection for each particular option ,div container corresponding to that option be made visible and rest div containers remain invisible using KnockoutJs.

e.g
array is:

this.Types=ko.observableArray([{name:'op1'},{name:'op2'},{name:'op3'},{name:'op4'}]);

html:

<select data-bind='options:Types, optionsCaption:"(Select a Type)", optionsText:"name", value:seltype'></select>  

<div> id=1 style="display:none"> id1 </div>     
<div id=2 style="display:none"> id2 </div>  
<div id=3 style="display:none"> id3 </div>  
<div id=4 style="display:none"> id4 </div>  
  • 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-12T09:39:35+00:00Added an answer on June 12, 2026 at 9:39 am

    Here is a solution using the visible binding on the DIVs elements:

    <select data-bind='options:Types, optionsCaption:"(Select a Type)", optionsText:"name", optionsValue: "name", value:seltype'></select>  
    
    <div data-bind="visible: seltype() === 'op1'"> id1 </div>     
    <div data-bind="visible: seltype() === 'op2'"> id2 </div>  
    <div data-bind="visible: seltype() === 'op3'"> id3 </div>  
    <div data-bind="visible: seltype() === 'op4'"> id4 </div> 
    

    See this fiddle for a working example.

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

Sidebar

Related Questions

I have a text submission box, a category dropdown and then three sport dropdowns
I have a dropdown box which is populated from a mysql table. When viewing
I have a dropdown box where the user can select a method to check
For example I have a dropdown box that gets a town from the table
I have a one dropdown box in webpage that is with autopostback = true
I have a PHP registration that calls a mysql db for a dropdown box.
INSERT MODE i have check box in one tr. and another dropdown control in
I want to have a drop down box that has a list of different
I have a drop down select box inside a div. When the user clicks
I have a normal HTML select dropdown box <select id=day name=day> <option value=0>All</option> <option

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.