XHTML Validation using Javascript in <td> tag

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • trusst_3@hotmail.com

    XHTML Validation using Javascript in <td> tag

    Hello,

    This is the only line in my entire code that does not validate in
    XHTML :

    <td width="24" bgcolor="#33006 6" onclick="javasc ript:color1()"
    class="borderWi dthr"></td>

    However, it is valid HTML,since I've defined the function color in the
    javascript section of the <head> tag.

    This is the error that I get:

    Below are the results of attempting to parse this document with an
    SGML parser.

    Line 176, column 40: there is no attribute "onClick" (explain...).

    (And Yes.. onclick is not in Caps in my code).

    Do I specifically need a form object for it to validate in XHTML???
    Something like
    <input name="mybutton" type="button" onclick="color1 ()" />

    Any comments/suggestions would be greatly appreciated!

    Thanks
    Russ
  • David Dorward

    #2
    Re: XHTML Validation using Javascript in &lt;td&gt; tag

    trusst_3@hotmai l.com wrote:
    [color=blue]
    > This is the only line in my entire code that does not validate in
    > XHTML :
    >
    > <td width="24" bgcolor="#33006 6" onclick="javasc ript:color1()"
    > class="borderWi dthr"></td>[/color]

    Eugh. What a lot of deprecated yuck that should be moved to CSS. It looks
    like table abuse too.


    [color=blue]
    > However, it is valid HTML,since I've defined the function color in the
    > javascript section of the <head> tag.[/color]

    There is no relationship between the existance of a JavaScript function, an
    the validity of the code HTML.
    [color=blue]
    > This is the error that I get:
    >
    > Below are the results of attempting to parse this document with an
    > SGML parser.
    >
    > Line 176, column 40: there is no attribute "onClick" (explain...).
    >
    > (And Yes.. onclick is not in Caps in my code).[/color]

    Then either:

    (1) Something is wrong with the validator
    or
    (2) You are misreading your own code

    I suspect that 2 is more likely. A URI would make it a lot easier to
    troubleshoot.
    [color=blue]
    > Do I specifically need a form object for it to validate in XHTML???[/color]

    No.

    --
    David Dorward <http://dorward.me.uk/>

    Comment

    • Nick Kew

      #3
      Re: XHTML Validation using Javascript in &lt;td&gt; tag

      In article <8308b7c8.04011 21816.2ff2a517@ posting.google. com>, one of infinite monkeys
      at the keyboard of trusst_3@hotmai l.com wrote:
      [color=blue]
      > (And Yes.. onclick is not in Caps in my code).[/color]

      I don't believe you.

      A URL would resolve the matter.

      --
      Nick Kew

      Comment

      Working...