Speed up development with full-stack environments for every branch.

Learn More

How to get selected option using jQuery

19635 Runs 113221 Views 51306 Copies


dipesh.parmar 55

published 4 years ago

      jQuery ready function. Specify a function to 
      execute when the DOM is fully loaded.
    $(document).ready( function ()
      /* we are assigning change event handler for select box */
    	/* it will run when selectbox options are changed */
    		/* setting currently changed option value to option variable */
    		var option = $(this).find('option:selected').val();
    		/* setting input box value to selected option value */
    Please login/signup to get access to the terminal.

    Your session has timed out.

    Dismiss (the page may not function properly).