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?

2 Answers 2

5

Use

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

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

Sign up to request clarification or add additional context in comments.

Comments

1

Maybe using replaceWith()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.