473,385 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

<div> tags

184 100+
Hi All,
In my dojo grid application, want to create <div> tag inside another <div> tag by using document.createElement('DIV');
I done as follows

Expand|Select|Wrap|Line Numbers
  1.  var outerNode = document.createElement('DIv');
  2.  outerNode .setAttribute('dojoType','dijit.Menu')
  3.  document.body.appendChild(outerNode );
  4.  var innerNode1 = document.createElement('DIv');
  5.  innerNode1 .setAttribute('dojoType','dijit.MenuItem);
  6. innerNode1 .innerHTML='cut';
  7.  document.body.appendChild(innerNode1 );
  8.  
  9.  var innerNode2 = document.createElement('DIv');
  10.  innerNode2 .setAttribute('dojoType','dijit.MenuItem);
  11. innerNode2 .innerHTML='copy';
  12. document.body.appendChild(innerNode2);
  13.  
  14.  var innerNode3 = document.createElement('DIv');
  15.  innerNode3 .setAttribute('dojoType','dijit.MenuItem);
  16. innerNode3 .innerHTML=paste;
  17. document.body.appendChild(innerNode3);
  18.  
when i tried to print document.body.innerHTML i got
Expand|Select|Wrap|Line Numbers
  1. <div dojoType="dijit.Menu"></div>
  2.       <div dojoType="dijit.MenuItem">cut</div>
  3.       <div dojoType="dijit.MenuItem">copy</div>
  4.       <div dojoType="dijit.MenuItem">paste</div>
  5.  
Hence the functionality is not working for me..
Expected is
Expand|Select|Wrap|Line Numbers
  1. <div dojoType="dijit.Menu">
  2.       <div dojoType="dijit.MenuItem">cut</div>
  3.       <div dojoType="dijit.MenuItem">copy</div>
  4.       <div dojoType="dijit.MenuItem">paste</div>
  5. </div>
How do i do?
Please correct me.. if i'm wrong
Feb 16 '09 #1
1 1922
gits
5,390 Expert Mod 4TB
you have to append the inner nodes to the outer node like this:

Expand|Select|Wrap|Line Numbers
  1. outerNode.appendChild(innerNode3);
kind regards
Feb 16 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Philo | last post by:
How do I select all <div> tags except those which contain a <table> tag somewhere within them? Example XML: <********************** sample input ***********************> <txtSectionBody>...
61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
7
by: Herbman | last post by:
Hi, I'm trying to position a <tr> ("row") element with CSS. The table itself is positioned with <div> tags. The problem is when I use <div> tags to position the rows within the table nothing...
18
by: Timothy Casey | last post by:
Thanks in advance... =~= Timothy Casey South Australia worloq@iprimus.com.au Formerly: casey@smart.net.au
5
by: hibernate | last post by:
I'm somewhat new to javascript/DHTML, and this problem has been plaguing me. I have made an 'array' of <div> tags within my html document like so: <div id="menu"> menu1 </div> <div id="menu">...
1
by: Steve Klett | last post by:
Hi- I was just looking at te source for a site that I really liked and I noticed they are using DIV tags where I assumed that would be using a mess of nested tables. Now, this looks like a much...
8
by: Patrick | last post by:
Hi you all, I've just downloaded the latest beta of the .Net Framework and Visual Studio Expression 2005 edition. I only created a simple ASPX file with some code-beside/behind (however you want...
4
by: harryusa | last post by:
I am trying to center 2 images concentrically which are z-indexed to lay on top of each other making an image with a border from another image that has a transparent center. I need the images to be...
8
prino
by: prino | last post by:
Hi all, I've written code (in REXX) that takes files in legacy languages (PL/I, COBOL, z/OS assembler, etc) and converts them into HTML in a format similar to what's displayed in the z/OS ISPF...
7
by: cmrhema | last post by:
Hi, I have two questions. 1. I have heard that replacing a <tr> <td> with <div> tags increases the rendering speed. Is it so, and if yes which speed does it increase, rendering speed or loading...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.