I have been trying to figure it out in Jquery, despite being new and
quite un-experienced with Javascript.
Here are a few bits of what i have so far.

I know that i need to hide all of the child divs (the ones that will
show and hide) on load..
Then as for my event...I need to grab the value out of the option that
is selected, then match it with the correct div id and display that .
So here is what i have. Unfort it does not work yet but i think i am
on the right path.

        $(document).ready(function(){
        $("#stateHolder>div").hide();
        $("#stateList").change(function(){ $("#"+$
("this").val().show( 'fast');
        });


Any help would be appreciated. Btw, here is the corresponding html
needed to understand my naming and all..

<select id="stateList">
                <option value="alabama">Alabama</option>
                <option value="alaska">Alaska</option>
                etc...
</select>

    <div id="stateHolder">
            <div id="alabama">
                <p>This is Alabama</>
           </div> <!-- End of Alabama div -->

            <div id="alaska">
                   <p> Hi, I am Alaska </p>
            </div> <!-- end of alaska -->

    </div> <!-- End of stateHolder Div -->

Any help is appreciated. Thanks

Reply via email to