Re: How to count HTML elements in a given table-row or coloumn?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Joe Fawcett (joefawcett_at_hotmail.com)
Date: 02/24/05


Date: Thu, 24 Feb 2005 12:11:02 -0000


"caglaror" <caglaror@gmail.com> wrote in message
news:1109232129.064269.58680@o13g2000cwo.googlegroups.com...
> How to count HTML elements in a given table-row or coloumn?
> And how to handle their properties?
>
>
> Note: I have to catch the value of an input element in a given row
> (html element). But i can'nt control the id and name properties.
> Thanks
>
If you know which cell, e.g. the third cell then, assuming your table has an
id of "tblData" and you're looking at the second row:

var oTable = document.getElementById("tblData");
var oCell = oTable.rows[1].cells[2];
var oInput = oCell.getElementsByTagName("input")[0];
alert(oInput.value);

This assumes that there are no other input elements in the cell. If this
isn't good enough post a sample of your table structure and specify how you
know which row to inspect.

-- 
Joe (MVP)


Relevant Pages

  • How to count HTML elements in a given table-row or coloumn?
    ... How to count HTML elements in a given table-row or coloumn? ... I have to catch the value of an input element in a given row ...
    (microsoft.public.scripting.vbscript)
  • Re: NEED MACRO FOR COLOUR BY CONDITIONAL FORMATTING
    ... NewShRowCount = NewShRowCount + 1 ... OldShRowCount = OldShRowCount + 1 ... put coloumn no. so it only copy that much into new sheet. ... And also is there way i can get row copy from cell A to ...
    (microsoft.public.excel.programming)
  • Re: NEED MACRO FOR COLOUR BY CONDITIONAL FORMATTING
    ... put coloumn no. so it only copy that much into new sheet. ... NewShRowCount = NewShRowCount + 1 ... And also is there way i can get row copy from cell A to ...
    (microsoft.public.excel.programming)
  • Re: NEED MACRO FOR COLOUR BY CONDITIONAL FORMATTING
    ... put coloumn no. so it only copy that much into new sheet. ... NewShRowCount = NewShRowCount + 1 ... And also is there way i can get row copy from cell A to ...
    (microsoft.public.excel.programming)
  • Re: Please Help
    ... is there any way to make this kind of macro. ... received the macro but this only work for one coloumn I want to get ... I get "Interior.Colorindex = 3" or Red colour in coloumn B cells ... then cell get Red colour. ...
    (microsoft.public.excel.programming)