开发者

dojo equivalent of document.X

What will be the dojo equivalent code of following.?

var msgContainer = docum开发者_C百科ent.createElement('div');
msgContainer.id = 'alert';             // set id of div
msgContainer.setAttribute('role', 'alert');
msgContainer.className = 'contenthide' // set class name
msgContainer.appendChild(document.createTextNode(msg));
document.body.appendChild(msgContainer);


var div = dojo.byId('alert');
while (div) {
 div.parentNode.removeChild(div);
 div = dojo.byId('alert');
}


var msgContainer = dojo.create("div", { 
                           id:"alert",
                           role:"alert",
                           "class":"contenthide",
                           innerText:msg }, dojo.body());

Please check on the Dojo Toolkit's documentation for more DOM functions.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜