jquery - chnage() function not working with Select list Items -


hi friends trying show option value in alert box shows when change in select item list failed code below or can see demo here http://jsfiddle.net/exnkk/1/

html

<select name="select" id="editorfont">                               <option value="arial">font 1</option>                               <option value="alex_brushregular">font 2</option>                               <option value="quicksandregular">font 3</option>                             </select> 

script

$('select#editorfont').change(function (){                 var value = $(this).children('option').val;                 alert(value);             }) 

please friends

thanks in advance.. :)

try like

$('select#editorfont').on('change',function (){     var value = $(this).val();     alert(value); }); 

and need put in dom ready.see demo


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -