referencing a span id in javascript


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: referencing a span id in javascript

  1. #1
    Craig Roberge Guest

    referencing a span id in javascript


    Hi,

    I'm trying to dynamically show and hide tablecells. The table cells are enclosed
    in span tags and are dynamically created using ASP. Using the onclick event
    of the span tag I call a function to hide and show cells,passing the span
    id to the function. Depending on the id other cells are either shown of hidden.

    I can change the current cell by passing 'this', and also any cells that
    were static in the page, but when it is dynamically created using ASP I get
    an error. The error says that the id of span, spanid.style.visibility, is
    not an object.

    How can I reference these dynamic span id's in javascript.

    Can anyone help.

    Thanks
    Craig

  2. #2
    John Cogan Guest

    Re: referencing a span id in javascript


    Hi

    I am not an expert but I am thinking that you should proberly use the collections
    array for span tags, if one exists... ?


    "Craig Roberge" <craigroberge@bigfoot.com> wrote:
    >
    >Hi,
    >
    >I'm trying to dynamically show and hide tablecells. The table cells are

    enclosed
    >in span tags and are dynamically created using ASP. Using the onclick event
    >of the span tag I call a function to hide and show cells,passing the span
    >id to the function. Depending on the id other cells are either shown of

    hidden.
    >
    >I can change the current cell by passing 'this', and also any cells that
    >were static in the page, but when it is dynamically created using ASP I

    get
    >an error. The error says that the id of span, spanid.style.visibility, is
    >not an object.
    >
    >How can I reference these dynamic span id's in javascript.
    >
    >Can anyone help.
    >
    >Thanks
    >Craig



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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center