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

find div node inside a div

Suppose I have <div id="outter"element. In side the div, I have
other <divand <imgelements. I used the following code

insideElementsList = outterDiv.childNodes;
for (var i = 0; i < list.length; i ++){
insideElementList[i] ...
}

In the loop, how can I know the current element is a <divor a <img>?

Thanks,

ff

Jul 13 '07 #1
1 1454
On Jul 13, 3:20 pm, finecur <fine...@yahoo.comwrote:
Suppose I have <div id="outter"element. In side the div, I have
other <divand <imgelements. I used the following code

insideElementsList = outterDiv.childNodes;
for (var i = 0; i < list.length; i ++){
insideElementList[i] ...

}

In the loop, how can I know the current element is a <divor a <img>?

Thanks,

ff
If you just want DIV's, use getElementsByTagName instead of a loop.
Otherwise use the tagName property.

Jul 13 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Miguel J. Jiménez | last post by:
Hi, I have the following node: <node> Some text here with lots of inside it... </node> and I would like it to transfrom it using XSLT to the following: Some text<br/> here with</br> lots...
3
by: Eshrath | last post by:
Hi, I have an xsl where a particular child node (<sub1> and <sub2> )can occur in two type of parent nodes (<A> and <B>). like <A> <sub1>11</sub1> <sub2>22</sub2>
2
by: bissatch | last post by:
Hi, I am currently writing a simple PHP program that uses an XML file to output rows for a 'Whats New' page. Once written, I will only require updating the XML file and any pages that use the...
9
by: Bernd.Moos | last post by:
Given the following XML document: <text> <p> <w>Ronaldo</w> <w>scoredw> <w>the</w> <w>1</w> <c>:</c> <w>1</w>
3
by: Sunny | last post by:
Hi, I'm using VS.net 2003 and C#. I created (using buildin designer) a dataset with 2 tables. TableOne has 2 fields: sName and sTable (both string) and a primary key TestKey, set on sName....
2
by: Raed Sawalha | last post by:
I have following XML: How can I find the depth of XML? in other word max level of the XML <Root> ----- level 0 <Name>----- level 1 <FirstName>name</FirstName> ---- level 2...
0
by: RJN | last post by:
Hi I have to read an xml and add the node elements into a hashtable with nodename as key and nodetext as value. If the selected node has childnodes, then value should go as an array. for eg.,...
8
by: Dylan Parry | last post by:
Hi folks, I have an XML node called "myNode" and it contains: "This is some text" Now I can use the myNode.nodeValue property to get the string of text above. But say myNode contains: ...
2
by: Geagleeye | last post by:
Hi... how do i create a new xmlnode inside a node ... i have folowing code : Dim tmpElement As MSXML2.IXMLDOMElement Dim nlItems As MSXML2.IXMLDOMNodeList Dim tmpNode As MSXML2.IXMLDOMNode
5
ram09
by: ram09 | last post by:
I had made a tree view of folders in a rad tree view... I have added a text box with a button in one of my nodes, using this code node.controls.add(txtbox) node.controls.add(btn) where, txtbox...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.