tags:

views:

127

answers:

2

I have:

<input id="ONE" type="..." ...>

I want to replace this with:

<select id="TWO">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
<select>

How do I do that?

+1  A: 

Maybe using replaceWith()

Yacoby
+4  A: 

Use

$("#ONE").replaceAll("#TWO")

like described here. You can use replaceWith(content) if you want to specify replacing content in JS.

PanJanek