How to access object using jQuery and HTML select element?
<p>I have this structure:</p>

<pre><code>var data = {
    'horizontal':{
         'static':[1,3,5,7,9],
         'dynamic':[2,4,6,8]
    },
    'vertical':{
         'static':[1,3,5,7,9],
         'dynamic':[2,4,6,8]
    }
};
</code></pre>

<p>I have this HTML objects:</p>

<pre><code>Direction:
&lt;select id="direction"&gt;
    &lt;option value="horizontal"&gt;Horizontal&lt;/option&gt;
    &lt;option value="vertictal"&gt;Vertictal&lt;/option&gt;
&lt;/select&gt;

Type:
&lt;select id="mytype"&gt;
    &lt;option value="static"&gt;Static&lt;/option&gt;
    &lt;option value="dynamic"&gt;Dynamic&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>Can I access to the <code>data.horizontal.static[2]</code> somehow like this?</p>

<pre><code>var result = data.[ $('#direction').val() ].[ $('#mytype').val() ][2];
</code></pre>

<p>Is there any way?</p>
