質問

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