58 users online (0 members and 58 guests)  


  Results 1 to 2 of 2

Related

  1. Scrollbar in a cell in a table?    Forum: HTML Forum
    Replies: 6
  2. Scroll bar in table cell help    Forum: HTML Forum
    Replies: 14
  3. table cell background    Forum: CSS Forum
    Replies: 3
  4. manipulate table cell    Forum: Javascript Forum
    Replies: 3
  1. #1
    wadars01's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2003
    Posts
    2

    Angry accessing table cell attributes

    I have a large table that I place no data in but just
    colors but as you pass over cells I have information in
    the ID and TITLE attributes of the td tag. I am trying
    now to place the TITLE attribute value into a text field
    in a form when the mouse is clicked over the cell. I have all
    the code working except getting the value of the TITLE
    attribute. I have looked and looked and tried various
    code but no success.

    I thought it would be something like

    document.td.title
    or
    document.td.getAttribute("title")
    or some variation of this

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hiya. Welcome to the forums.

    Because it needs a specific html element, that always tells you you need to access the ID of the tag to get any results. Here is a simple script I did to show how I accessed this -

    Code:
    <h1 id="thisisit" title="Badger Badger">Stoaty</h1>
    
    <script language="JavaScript">
    alert(thisisit.title);
    </script>
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Tags for this Thread