Вопрос

My code is here: http://jsfiddle.net/spadez/LRFMQ/14/

I tried to add two select fields to each line when hitting the add question button, so the added questions have the same fields as the initial one.

This is the problem bit of the code:

<select>
    <option value="single">Single line reply</option>
    <option value="multi">Paragraph reply</option>
</select>
<select>
    <option value="single">Required</option>
    <option value="multi">Optional</option>
</select>

It doesnt seem to like the way I have added my html form code into the javascript. Do I need to escape it somehow?

Это было полезно?

Решение

Use a hidden div for structure and .clone it for adding.

$("div.toClone").clone().removeClass("toClone").insertBefore(InputsWrapper);

FIDDLE

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top