Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #19415
| 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> (permalink) |
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Reply-To | Thomas 'PointedEars' Lahn <usenet@PointedEars.de> |
| 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+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v |
| Face | iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg== |
| Subject | Re: javascript to test if anchor tag is contained within div tag |
| Newsgroups | comp.lang.javascript |
| References | <3191a789-89f0-4740-b9cc-77719dac2f60@googlegroups.com> <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<OcfhCO;9aNUc68?K]8DZm8W4\YJN<b@mF9jNikd5BoKGPB=12A7XM2o=n6]`:; |
| X-Complaints-To | usenet-abuse@arcor.de |
| Xref | csiph.com comp.lang.javascript:19415 |
Show key headers only | View raw
charles.e.finkenbiner@gmail.com wrote: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Please get a real name. > 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: <http://validator.w3.org/> > 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: <http://PointedEars.de/es-matrix>. > 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? <http://jibbering.com/faq/> <http://PointedEars.de/faq> -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
javascript to test if anchor tag is contained within div tag charles.e.finkenbiner@gmail.com - 2013-04-22 08:15 -0700
Re: javascript to test if anchor tag is contained within div tag Danny <dann90038@gmail.com> - 2013-04-22 13:18 -0700
Re: javascript to test if anchor tag is contained within div tag Danny <dann90038@gmail.com> - 2013-04-22 13:22 -0700
Re: javascript to test if anchor tag is contained within div tag charles.e.finkenbiner@gmail.com - 2013-04-22 17:34 -0700
Re: javascript to test if anchor tag is contained within div tag charles.e.finkenbiner@gmail.com - 2013-04-22 20:31 -0700
Re: javascript to test if anchor tag is contained within div tag Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-04-23 10:07 +0200
Re: javascript to test if anchor tag is contained within div tag Danny <dann90038@gmail.com> - 2013-04-23 11:50 -0700
Re: javascript to test if anchor tag is contained within div tag CharlesEF <charles.e.finkenbiner@gmail.com> - 2013-04-24 01:51 -0700
Re: javascript to test if anchor tag is contained within div tag Martin Leese <please@see.Web.for.e-mail.INVALID> - 2013-04-24 12:42 -0600
Re: javascript to test if anchor tag is contained within div tag CharlesEF <charles.e.finkenbiner@gmail.com> - 2013-04-24 14:40 -0700
csiph-web