Click here to Skip to main content
15,921,279 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
And for visibility
<script>
$(function(){   
        
    $("#Alert").click(function(){
        $('#AlertsTable').show();
    });  
    
});


Now I have Modified into this

<select id="myDropdown" width="200" size="2"> 
                    	<option value="Alert" id="Alert" selected="selected">Alert</option>
                		<option value="IR">IR</option>
                		<option value="Site">Site</option>
                		<option value="Devices">Devices</option>                    	
                	</select>


What I have tried:

At first I had put values like this

<div id="myDropdown" class="dropdown-content">
    <a value="Alert" type="button" class="btn btn-lg btn-default" href="#">Alert</a>
    <a value="IR" type="button" class="btn btn-lg btn-default" href="#">Incident Report</a>
    <a value="Site" type="button" class="btn btn-lg btn-default" href="#">Site</a>
    <a value="Devices" type="button" class="btn btn-lg btn-default" href="#">Devices</a>
  </div>
Posted
Updated 17-Jul-17 20:41pm
Comments
Karthik_Mahalingam 18-Jul-17 2:10am    
use on-change event instead of click
Member 13233111 18-Jul-17 2:35am    
can you write a small example
Karthik_Mahalingam 18-Jul-17 2:41am    
check the solution

1 solution

try
$(function () {
           $('#myDropdown').change(function (a, b) {
               var value = a.target.value;
               if (value == 'Alert') {
                   alert(value);
               }

           });
       });
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900