DIV and TD

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Falc2199

    DIV and TD

    Can anyone tell me how I can make the following work...

    <table>
    <div id="1">
    <tr><td>testing </td></tr>
    </div>

    <input type="button" value="test" onClick="javasc ipt:removeQuest ion('1','1')">
    </table>

    The Javascript will not recognize the div because it is wrapped in TR and TD.
  • Ivo

    #2
    Re: DIV and TD


    "Falc2199" wrote[color=blue]
    >
    > <table>
    > <div id="1">
    > <tr><td>testing </td></tr>
    > </div>
    >
    > <input type="button" value="test"[/color]
    onClick="javasc ipt:removeQuest ion('1','1')">[color=blue]
    > </table>
    >
    > The Javascript will not recognize the div because it is wrapped in TR and[/color]
    TD.

    Right. Table elements may only contain thead, tbody, tfoot, tr and such
    elements, and tr elements may onnly contain th and td elements. If your
    source does not live up to this, http://validator.w3.org/ will quickly tell
    you.
    I don't know why you want that div element element in the first place. If
    you need an id'ed element (I would use a letter as the first character btw),
    set it on the tr or td directly:
    <tr id="bar"><td id="foo"></td></tr>

    \HTH
    Ivo


    Comment

    Working...