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

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -