开发者

Replace an entire html tag with another one using Jquery?

开发者 https://www.devze.com 2022-12-13 02:00 出处:网络
I have: <input id=\"ONE\" type=\"...\" ...> I want to replace this with: <select id=\"TWO\">开发者_JAVA技巧;

I have:

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

I want to replace this with:

<select id="TWO">开发者_JAVA技巧;
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
<select>

How do I do that?


Use

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

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


Maybe using replaceWith()

0

精彩评论

暂无评论...
验证码 换一张
取 消