Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
177
rated 0 times [  179] [ 2]  / answers: 1 / hits: 30096  / 16 Years ago, thu, march 26, 2009, 12:00:00

I have a the following static div:



<body>
<div id=div1></div>
....


I want to add a div with id div1_1 within div1 dynamically by using dojo. How can I do it?


More From » dojo

 Answers
8

You can do it using just Dojo Base — no need to include anything, if you use the trunk or Dojo 1.3:



dojo.create(div, {id: div1_1}, div1);


This line creates a div with id div1_1 and appends it to the element with id div1. Obviously you can add more attributes and styles in one go — read all about it in the documentation for dojo.create().


[#99791] Friday, March 20, 2009, 16 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jadyngraysons

Total Points: 455
Total Questions: 109
Total Answers: 98

Location: Trinidad and Tobago
Member since Fri, May 8, 2020
4 Years ago
jadyngraysons questions
Thu, Apr 23, 20, 00:00, 4 Years ago
Sat, Jan 18, 20, 00:00, 4 Years ago
Tue, Dec 31, 19, 00:00, 4 Years ago
;