开发者

unregister/delete all child nodes of a div tag in dojo

I have a div tag, lets say "mydivTag"

It has a child node under it with an ID of "childID"

I want to delete/unregister/whatever "childID" and then recreate a different node with the same ID, "childID"

How do I achieve r开发者_如何学编程emoval of the first object with ID "childID" so that when I make my new object with that same ID, I don't get an error about there already being a widget registered with the ID "childID"

Thanks


have you tried something like

dojo.query("#childID", mydivTag).orphan()

then

dojo.create("div", {id: "childID"}, mydivTag)

These are just shorthand for DOM APIs like removeChild and createElement

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜