I am writing a script where you can add and remove a drop-down list of languages. I got it working, but my question is is there a way to externalize part of the select tag of the code, since I would have more than 100 options and load it in JavaScript when the link is clicked. I do not want to have 100 parameter tags in a script. On the PHP side, I use the include statement to load a list of parameters.
That is where my problem is.
$(function() { var scntDiv = $('#container'); var i = $('#container p').size() + 1; $('#addScnt').live('click', function() { $('<p><select>I DONT WANT TO HAVE 100 OPTION TAGS HERE</select></p>').appendTo(scntDiv); i++; return false; }); });
here is my code that works with multiple parameter tags in a script.
Full code .
source share