javascript - insert text into textarea when option selected -


i need help. i'm trying insert text textarea-element when url contains 'number' , option value='option2' of selectbox selected.

 var contenttoinsert = 'text'; if (location.href.indexof("/number")) {   if (value of selectbox == 'option2') {     $("textarea").append(contenttoinsert);   } } 

how check when option selected? text insert shouldn't shown when option selected. mean need on event-handler onchange.

have got idea?

jquery .change() event exists :

description: bind event handler "change" javascript event, or trigger event on element.

thy :

http://jsfiddle.net/j4rkt/


Comments

Popular posts from this blog

Cursor error with postgresql, pgpool and php -

delphi - ESC/P programming! -

c++ - error: use of deleted function -