Search code examples
jquerydropdown

Jquery show div from option already "selected"


I want show div when its run without having to select first, this is my code line, I need help, thank you in advance. here's my script fiddle

I have successfully displayed div when the option option is change, what I want is when it's first run, the selected option that already selected appears immediately, I am searching but confused by this line of code: $(this).find("option:selected").each(function().

My script before inline : 8 the option value="5" is already "selected", but when I run the code, it must change the option to sho the div. (sorry for my bad english).


Solution

  • just use $('#pilih-jurusan').change(); at the end of code