I am trying to populate second dropdown list based on first dropdown list selection using Ajax, jQuery,PHP and MySQL. the problem is the options in second dropdown list just app
You are setting $('#result').html(data);
in the main file.
result
should be the id of the HTML select
element, you used it as id for the an option
element.
(You are appending the values into the option
element, which doesn't create new HTML elements, but they should be inserted into the select
element.)