CreateElement with id?

后端 未结 7 1926
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 01:05

I\'m trying to modify this code to also give this div item an ID, however I have not found anything on google, and idName does not work. I read something about append

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 01:31

    Why not do this with jQuery?

    var newDiv= $('
    ', { id: 'foo', class: 'tclose'})

提交回复
热议问题