Skip to content Skip to sidebar Skip to footer

Change Selected Value Of Dynamically Generated Dropdown List

I have a dynamic drop down list generated in a JSP page as follow:

Solution 1:

I don't see anything in your HTML with an id of model. Did you mean for the input with a name of model to also have that as an id?

I also notice there is no ending </tr> in your second table.

Don't use var rowData = new Array(); use literal notation: var rowData = [];.

After adding on the id, adding a couple <tr>s, it worked for me fine:

http://jsfiddle.net/FJfZK/

Note, that your rendered HTML output is much more helpful when debugging a JavaScript issue. We generally don't care what your server is doing, when it is a DOM manipulation issue.

Post a Comment for "Change Selected Value Of Dynamically Generated Dropdown List"

Model: