Triggered By Select Change Event : trigger « jQuery « JavaScript DHTML






Triggered By Select Change Event

    


<html>
  <head>
    <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
      
            $("select").change(function () {
               var str = "";
               $("select option:selected").each(function () {
                  str += $(this).text() + " ";
              });
              $("div").text(str);
            }).trigger('change');
        });
    </script>
  </head>
  <body>
    <select name="A" multiple="multiple">
        <option>A</option>
        <option selected="selected">B</option>
        <option>C</option>
    </select>
    <div></div>
  </body>
</html>

   
    
    
    
  








Related examples in the same category

1.Trigger Another Event
2.Trigger handler
3.Triggers the blur event of each matched element
4.Trigger Submit Event
5.Trigger a custom event
6.trigger(type , data )
7.To submit the first form without using the submit() function
8.Display a "Hello World!" alert box.