I need your help. I'm trying to insert some text into a textarea-element when the url contains 'number' and an option with value='option2' of a selectbox is selected. var contentToInsert = 'Text'; if (location.href.indexOf("/number")) { if (value of selectbox == 'option2') { $("textarea").append(contentToInsert); } }
How do I check when the option is selected? The text to insert shouldn't be shown when another option is selected. So this would mean that I need on event-handler like onchange.
Have you got an idea?