473,394 Members | 1,746 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,394 software developers and data experts.

DOM createElement in a specific location

42
Hello, im new here :)

I got a problem with the application im writing at the moment, lets say I have 10 tables with the id 1-10 and I want to place a new table using DOM below the table the person clicks...

So if I click on table 7 I want to place a new table below it but the problem is I dont know how to append tables after another table.. the only way I know how to do this is by using appendChild but that means I have to append it inside the same table or at the bottom of the outside table..
Jul 19 '07 #1
3 1458
acoder
16,027 Expert Mod 8TB
Welcome to TSDN!

You can use insertBefore and using it with the next table object. You can simulate insertAfter (which doesn't exist) using insertBefore and the nextSibling property. See the linked page for more information.
Jul 19 '07 #2
Gozil
42
Thanks, that was just what I was looking for :)
Jul 19 '07 #3
acoder
16,027 Expert Mod 8TB
Thanks, that was just what I was looking for :)
No problem, you're welcome. Post again if you have any more problems.
Jul 19 '07 #4

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

Similar topics

25
by: kie | last post by:
hello, i have a table that creates and deletes rows dynamically using createElement, appendChild, removeChild. when i have added the required amount of rows and input my data, i would like to...
2
by: kie | last post by:
hello, when i create elements and want to assign events to them, i have realised that if the function assigned to that element has no parameters, then the parent node values can be attained. ...
9
by: Kim | last post by:
Hi I'm trying to do something like this. for(i=0; i<5; i++){ var theData = document.createElement('a'); theData.onmouseover = function() { return get(i);} ... ... }
4
by: Nalaka | last post by:
Hi, I have some request specific data that gets created in a "early event", that I need to pass around to many other events. I need access to this data during that request. (and more importantly...
1
by: k386 | last post by:
I am having trouble creating a hidden form field, or least having it accessible from getElementById. Rough overview: I am reading an XML file through XMLhttpRequest and outputting each item...
3
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table...
4
by: Narven | last post by:
Hi, I've been creating a script that dynamic loads js files. but after creating that script, (and i use document.createElement('script');) in that function.. i've realise that the code that...
4
by: Pool | last post by:
I tried to connect DB2 (Sitting in Unix server at my client location) using Db2 connect V8. I am getting the following error message. I tried all the possible options BUt the error is same.. See each...
7
by: r_ahimsa_m | last post by:
Hello, I am learning JavaScript. I have a table on HTML page:                 <table id="announcement_fields" border="0">                 <tbody>                 <tr>...
23
by: vunet | last post by:
It is recommended by some sources I found to create IFrames in IE using document.createElement('<iframe src="#">') instead of document.createElement('iframe'). Why and what browser versions to...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.