jQuery for hiding other columns options(dynamic) except column one. and onClick it shows other <p>I am having a problem regarding jQuery. In my (codeigniter)view file i have created a columns which are fetching data from the database perfectly. All i want is to put a jQuery that shows only column_one(id : col_1) firstly, and all the remaining columns would be blank. when i click on any option of the first column it shows second column options.</p> <p>I am newbie to jQuery and i wonder if i can do this. Sorry, in advance if it is a silly one!</p> <p>Here is my script i am trying in my view file. Hope you all can get what i am trying.</p> <p><strong>Script :</strong></p> <pre><code>$('document').ready(function()) { var link = "&lt;?php echo base_url(); ?&gt;" ; //click cat_1, get cat_2 $('#cat_1').click(function() { var cat_1 = $(this).val(); // getting data of cat_level_2 from cat_1 $.post(link + 'admin/admin_cat/category/cat_level_2' , {cat_1:cat_1}, function(data) { $('#cat_3').html(''); $('#cat_level_4').html(''); $('#cat_2').html(data); }); }); $('#cat_2').click(function(){ var cat_2 = $(this).val(); // getting data of cat_level_2 from cat_1 $.post(link + 'admin/admin_cat/category/cat_level_3 ' , {cat_2:cat_2}, function(data) { $('#cat_3').html(data); $('#cat_level_4').html(''); }); }); } </code></pre> <p>Here i have created a columns in view file. which is fetching data from database.</p> <p><strong>Columns :</strong> </p> <pre><code>&lt;div class="category-col"&gt; &lt;select size="15" name='cat_1' id='cat_1'&gt; &lt;?php foreach ($dropdown as $cat_1) ?&gt; &lt;?php { ?&gt; &lt;option value=" &lt;?php echo form_dropdown('cat_level', $dropdown);?&gt; "&gt; &lt;/option&gt; &lt;?php } ?&gt; &lt;/select&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; &lt;/script&gt; &lt;div class="category-col"&gt; &lt;select size="15" name='cat_2' id='cat_2'&gt; &lt;?php if(isset($cat_level_2) &amp;&amp; $cat_level_2 != false){ ;?&gt; &lt;?php foreach ($cat_level_2 as $cat_2) {?&gt; &lt;option value=""&gt; &lt;?php echo $cat_2; ?&gt; &lt;/option&gt; &lt;?php } }?&gt; &lt;/select&gt; &lt;/div&gt; &lt;div class="category-col"&gt; &lt;select size="15" name='cat_3' id='cat_3'&gt; &lt;?php if(isset($cat_level_3) &amp;&amp; $cat_level_3 != false){ ;?&gt; &lt;?php foreach ($cat_level_3 as $cat_3) {?&gt; &lt;option value=""&gt; &lt;?php echo $cat_3; ?&gt; &lt;/option&gt; &lt;?php } }?&gt; &lt;/select&gt; &lt;/div&gt; </code></pre> <p>Thanks for the consideration mates!</p>