Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit4.readnews.com!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <3526876.2WAoL8vqck@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Tue, 23 Apr 2013 10:07:07 +0200 User-Agent: KNode/4.8.5 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. <71e89685-4598-4b92-86d4-f01253a846f9@googlegroups.com> <85d30fa5-56d9-456a-9c48-67ce4b36bedf@googlegroups.com> <30b40f71-e1fa-40a9-a246-0dfb07ba3a2b@googlegroups.com> MIME-Version: 1.0 Lines: 63 NNTP-Posting-Date: 23 Apr 2013 10:07:08 CEST NNTP-Posting-Host: 905b4f1b.newsspool3.arcor-online.net X-Trace: DXC=W<>G]I9M`T2TQL:hoD@>T?McF=Q^Z^V384Fo<]lROoR18kF Well, what sounded easy is turning into a pain for me. I have very basic > HTML and javascript skills so please bear with me. > > Based on my sample HTML code above anchor.parentNode.tagName only returns > the element LI. Also, since I am only looping the anchors I never seem to > reach any DIV tag. /Element/, _not_ tag. In a document, elements are nested, they have attributes and content (which may be text or other elements). That is what forms a document *tree* structure. *Every* node that is not at the root level has a parent element node – like a leaf has a twig, a twig has a branch, a branch has a trunk, and a trunk has a root it sits on. You can retrieve a reference to an element node's parent (element) node by using the “parentNode” property (whose value is “null” at the root level). So, in real life, what do you do when you want to get from the leaf to the branch its twig sits on? What do you do when you are sitting on a twig and want to get from the twig to the trunk, or to the root? And not all elements can be nested in all other ones. The “div” element cannot be nested *directly* in a “ul” element, that is, as its /child/ element. The child elements of “ul” elements must be “li” elements. So before you go any further, you must fix your markup. You must decide on HTML code that suits your purpose *and* is Valid: > To Danny, This is NetNews, not private e-mail. Skip the “to $Person” thing unless you really only want answers from $Person. Do not follow Danny's bad example. > […] > So, does this mean I am not coding the HTML or javascript correctly? It means that you are programming and posting without thought, and you are listening to people who do not really have a clue. So the outcome is necessarily rarely positive. You need to understand the underlying theory, the concepts, first, and you need to structure your thinking, considering carefully the current situation, the target, and *how* you could get to the target. Just dabbling around will _not_ get you there. BTW, there is no javascript: . > Maybe a little example will help me. Maybe not. What good is an example, what good is an explanation, that you do not understand because you are lacking the minimum clue? Maybe reading the FAQ, and the references to documentation; following those references, and *reading* the documentation, *before* posting, will help you. After all, that is why we put it there. So why do you not use it? -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.