Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 8th, 2008, 09:16 AM
Authorized User
 
Join Date: Sep 2008
Location: Oslo, , Norway.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to peirix
Default 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.

Code:
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:

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" />

 </colgroup>




Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting Dates Odifius Access VBA 2 September 26th, 2006 02:22 PM
counting in XSL gezi XSLT 8 March 29th, 2006 06:50 PM
Node counting sarahl2 XSLT 2 February 21st, 2006 02:25 PM
record counting keyvanjan Classic ASP Databases 0 June 30th, 2005 01:20 AM
Counting ?!? hcweb Classic ASP Basics 2 December 8th, 2003 05:08 PM





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