www.webdeveloper.com
Results 1 to 2 of 2

Thread: Please help

  1. #1
    Join Date
    Nov 2010
    Posts
    7

    Please help

    I ahve a dhtml table which has several rows. I want to get row Id of the rows which have "date" greater than the "date" of row clicked(provided that I have the row Id of row that I have clicked). How to traverse and get row Id by javascript ? e.g get rows Id where "date" > 1965.

    The table has "date" column field.

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    function validDate() {
    var ID_list = [];
    var needle = /^\s*(\d{4})\s*$/;
    var aObj = document.getElementsByTagName('td'); //could be more specific with known structure
    var i = aObj.length;
    while(i--) {
        var foo = aObj[i].innerHTML.match(needle);
        if(foo && Number(RegExp.$1)>1965) {ID_list.push(aObj[i].parentNode.id);};
        }
    alert(ID_list);
    }
    At least 98% of internet users' DNA is identical to that of chimpanzees

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles