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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do it using just Dojo Base — no need to include anything, if you use the trunk or Dojo 1.3:
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().