dshrenik
asked on
Dojo - Add a ul to a ul
I have a ul on my page with a dojoAttachpoint. I am creating a ul dynamically. I now want to add this ul dynamically to the first ul. Please let me know how this can be done.
Thanks!
Thanks!
ASKER
Can you tell me how I can do this dynamically with Dojo? Thanks!
No, never heard of Dojo.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi dshrenik,
This might do it too: dojo/html provides useful utilities for managing HTML.
Possibly something like this:
This might do it too: dojo/html provides useful utilities for managing HTML.
Possibly something like this:
require(["dojo/html", "dojo/dom", "dojo/on", "dojo/domReady!"],
function(html, dom, on){
on(dom.byId("setContent"), "click", function(){
html.set(dom.byId("content"), "<ul><li>Item 1></li><li>Item 2</li></ul>");
});
});
<button type="button" id="setContent">Set Content</button>
<div id="content">I haven't been replaced.</div>
Alan ";0)
Open in new window