Tuesday, December 03, 2013

jQuery Change Event, by default

I had a dropdownlist, on select of a value, will trigger a display of a table of contents, through some Knockoutjs binding.

As usual I placed a change event for the pastEventsYear dropdownlist, as:
 $("#pastEventsYear").change(function () {
            $('select option:selected').each(function () {               
Now, as you see, it is a "Change" function. Even if the default value (2012, in this case) is set on load of the page, the table contents do not display. So, I set the value of the "pastEventsYear" purposefully:
It should have worked. But it didn't. All I had to do was:
This triggered the change event.

No comments:

Post a Comment