ahmm95
ahmm95

Reputation: 95

jquery loading content from select

I'd like to load somethings in the page after a select input is selected.

HTML

<select id='select'>
    <option></option>
    <option>First Option</option>
    <option>Second Option</option>
</select>

JS

$('#select').focusout(function(){
    alert("It worked");
});

However I can't find and event that does it. I tried with .focusout(), but it didn't work how I expected. The main idea is to put two select inputs, and load the options from the second one after the first is selected. How can I do that?

Upvotes: 1

Views: 34

Answers (1)

display-name-is-missing
display-name-is-missing

Reputation: 4409

Try:

$('#select').change(function(){
    alert("It worked");
});

Upvotes: 1

Related Questions