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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:37:39+00:00 2026-06-15T13:37:39+00:00

I’m using a sliding menu (select/object html one), which is generated dynamically by taking

  • 0

I’m using a sliding menu (select/object html one), which is generated dynamically by taking data from a DB, using a jsp page.

I also have an input text field, where I can search things from the sliding menu.
I want to write the root of a word that is contained in my menu, and my menu must “resize” showing all the items with the root that I’ve wrote, and only those ones.

I can’t use server side operations (like sending data via post) but I need to solve this client side (because I need this result immediately).

Can I maybe solve this problem only with an onclick event applied to a button? And how?

  • 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-15T13:37:40+00:00Added an answer on June 15, 2026 at 1:37 pm

    See this demo: http://jsfiddle.net/UKseV/8/

    As it is not possible to hide an <option> with display:none (demo: http://jsfiddle.net/UKseV/ -style is added correctly, but it does not work), I clone select object to store initial options as they will be removed from initial object. And later I’m using that cloned object to filter options and add those that match my condition to initial object. Here is a code:

    HTML:

    <select multiple id="testSelect">
    <option>test</option>
    <option>temp</option>
    <option>cast</option>
    <option>dest</option>
    <option>inst</option>
    </select>
    
    <input type="text" value="" onkeyup="searhSelect(this)" />​
    

    searhSelect function will be called on each key press (when user release a key actually) and will filter #testSelect object.

    JS:

    var optionsList;
    function searhSelect(el) {
        var select = document.getElementById('testSelect');
        if(!optionsList) {        
            optionsList = select.cloneNode(true);  //copy select to a variable for future use      
        }
        select.innerHTML = "";//remove all options.
    
        for(var i =0; i < optionsList.options.length; i++) {
            var opt = optionsList.options[i];
            if((opt.innerText || opt.textContent).indexOf(el.value) != -1) {
                select.appendChild(opt.cloneNode(true));
            } 
        }
    }
    

    ​

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a text area in my form which accepts all possible characters from
I'm trying to select an H1 element which is the second-child in its group
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
i got an object with contents of html markup in it, for example: string
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker

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.