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

The Archive Base Latest Questions

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

i have a dropdown where there is a value of pixels and below is

  • 0

i have a dropdown where there is a value of pixels and below is a div with some data and
the div is of some width and height but what i need to do is when i select any value lets
suppose i selct 350px then the size of the div should automatically adjust accordingly. i
dont have any idea how to do that refer me any link so that i could get help from there.
i am serching for it or any kind of help on google for the last one hour.

here is the html

              <td>
                <select name="sizi_pixel" id="drp">
                    <option value="1">100 Pixels</option>
                    <option value="2">200 Pixels</option>
                    <option value="3">350 Pixels</option>
                    <option value="4">450 Pixels</option>
                    <option value="5">600 Pixels</option>
                </select>
               </td>

and here is the div i want to resize automatically

               <div style=" border-width:3px;border-style:solid;border-color:#ff9900; height:400px; width:300px">

                    <input class="color" value="999">
                            <input class="color" value="999">
                            <input class="color" value="999">
               </div>

any help will be appreciated

  • 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-12T04:12:52+00:00Added an answer on June 12, 2026 at 4:12 am

    This javascript should do the trick!

    You need to attach an event listener to your select input, also change the options to represent the value in the box. And give your div an id, I gave it the id ‘myDiv’.

    you can also see it working here: http://jsfiddle.net/6avqc/1/

    document.getElementById('drp').addEventListener('change', changeSize);
    
    function changeSize() {
        var myDiv = document.getElementById('myDiv');
        var selectbox = document.getElementById('drp');
    
        var index = selectbox.selectedIndex;
        var value = selectbox[index].value;
    
        myDiv.style.width = value + 'px';
    }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a dropdown as below, <select name=pid onchange=getReport(this.value)> <option>Select a PID:</option> <option value=SFP-GE-S>SFP-GE-S</option>
If i have a dropdown list that looks like this: <select id=select> <option value=Armoire>Armoire</option>
Is there any way to have a dropdown in excel that will show a
Say I have this dropdown: <select id=theOptions1> <option value=1>1</option> <option value=2>2</option> <option value=3>3</option> </select>
okay, i have a form dropdown <select name=select_category id=select_category> <option value=cheese-cakes>Cheesecakes</option> <option value=fruit-cakes>Fruitcakes</option> </select>
i have a dropdown list of countries.. the html code is as below: <select>
In my MVC3 application i have a dropdown list. In there i have to
I have dropdown-Lists which have a lot of elements (>1000). When I select one
I have dropdown menu..which is dynamic.. How can get value of the last item
I have dropdown menu below where it retrieves the possible modules id's and their

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.