Dynamically include jsp file with JavaScript DOM

Viewed 78

I want to us JS to create a new select element that looks like this:

<select name="component1" required>
    <option value="" disabled selected>Selected...</option>
    <%@ include file = "common/select_options.jsp" %>
</select>

I have been able to create the element apart from the:

<%@ include file = "common/select_options.jsp" %>

How can I add the include file statement to my select element? I have tried (select is the name of the element):

select.innerHTML = "<%@ include file = 'common/inventory_type_dropdown.jsp' %>"
0 Answers
Related