JQuery basic selector usage and non unique element ID

前端 未结 4 766
别那么骄傲
别那么骄傲 2021-01-22 10:38

I\'am maintaining a GUI built using JQuery. In one part of the GUI, multiple tabs can be opened to edit data.

When a new tab is opened, it is created by cloning the firs

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-22 11:30

    just a suggestion, can you make id of the input as class? So that you don't have a problem when cloning. and your code would be something like, $('#tabs-2 .scriptName').val( data.name );

提交回复
热议问题