Q:

Drop down combination

Hi all I am just a beginner in JavaScript. I tried to create a drop-down combination. But due to some reason this is not working.
This the html code:
<select id="MapSelect" onchange="changeChart();">
<option value="developmentRegionMap">Development Region</option>
<option value="ecoMap">Ecological Regions</option>
<option value="world_mill_en">Districts</option>
</select>

<select id="dataSelect" onchange="changeChart();">
<option value="CASTE1">CASTE1</option>
<option value="CASTE2">CASTE2</option>
</select>

This is the javascript portion;
    function changeChart() {
    var data={}
    var value = MapSelect.options[MapSelect.selectedIndex].value;
    var dataType = dataSelect.options[dataSelect.selectedIndex].value;

    if (value == "developmentRegionMap" && dataType == "CASTE1") {
            data=CASTE1_Developmental;
            alert("APPLE");
        }
    else if (value == "developmentRegionMap" && dataType == "CASTE2") {
            data=CASTE2_Developmental;
            alert("BALL");

        }

    else if (value == "ecoMap" && dataType == "CASTE1") {
            data=CASTE1_Eco;
            alert("CAT");
        }

    else if (value == "ecoMap" && dataType == "CASTE2") {
            data=CASTE2_Eco;
            alert("DOG");
        }

    else if (value == "world_mill_en" && dataType == "CASTE1") {
            data=CASTE1_Districts;
            alert("ELEPHANT");
        }

    else if (value == "world_mill_en" && dataType == "CASTE2") {
            data=CASTE2_CASTE2;
            alert("HEN");
    }

};

The jsfiddle  link to this code is:
http://jsfiddle.net/4yd2F/2/

A:

You need to physically retrieve the DOM objects you want to work with:
var mapSelect = document.getElementById('MapSelect');
var dataSelect = document.getElementById('dataSelect');

Here is an updated fiddle.
As Felix pointed out, what I suggested was not your main problem. The other issue is that you are not correctly using the javascript object type:
Wrong:
var data = {};
data = meh;

in this case meh is not a valid identifier since it was not defined as a variable nor is it a recognized identifier. 
Correct: 
data = {
    myString: 'hello',
    myArray: []
};

