p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Javascript (http://p2p.wrox.com/forumdisplay.php?f=85)
-   -   counting columns (http://p2p.wrox.com/showthread.php?t=70467)

peirix September 8th, 2008 09:16 AM

counting columns
Hi. I'm trying to figure out how to count number of <col />-tags inside the document. The reason I need to count them, is that the pages will be generated, and there is no way of knowing how many columns there will be, or what their id-tag will be.


var testObj = document.getElementById("colGroup").childNodes;
returned a very high number, so I guess that's no good.

I will also need to find out how to access the id-tag

sample code:


<colgroup id="colGroup">
   <col span="2" id="date" />

   <col id="win32" />
   <col id="win32_md_debug" />
   <col id="win32_md_release" />
   <col id="win32_mt_debug" />
   <col id="win32_mt_release" />

   <col id="ubuntu32" />
   <col id="ubuntu32_release" />

   <col id="solaris32" />
   <col id="solaris32_release" />

   <col id="osx32" />
   <col id="osx32_release" />

   <col id="centos64" />
   <col id="centos64_release" />

   <col id="gentoo64" />
   <col id="gentoo64_release" />


All times are GMT -4. The time now is 05:09 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.