Does my code contain anything invalid?

<form name="myForm" id="myForm">
<table id="myTab">
<tr>
<td>
<label for="id">User ID:</label>
<input type="text" id="id" />
</td>
</tr>
<tr>
<td>
</td>
<td>
<button type="button" class="submit">Submit</button>
</td>
</tr>
<tr><td><input type="reset" /></td></tr>
</table>
<div class="error"></div><div class="correct"></div>
</form>

• Put your URL here. It will validate the page. – Martin York Aug 25 '11 at 5:25
• If it's just html, don't / terminate single tags like input – Alex Aug 25 '11 at 6:37

According to the W3C (http://validator.w3.org/)

Your form tag is not valid.
Technically it must have an action attribute:

required attribute "ACTION" not specified in:
<form name="myForm" id="myForm">

The attribute given above is required for an element that you've used, but you have omitted it.

There are a couple of warnings:

Warning: NET-enabling start-tag requires SHORTTAG YES
<input type="text" id="id" / >
^^^ <!-- auto closing tag -->

The sequence can be interpreted in at least two different ways, depending on the DOCTYPE of the document. For HTML 4.01 Strict, the '/' terminates the tag '). However, since many browsers don't interpret it this way, even in the presence of an HTML 4.01 Strict DOCTYPE, it is best to avoid it completely in pure HTML documents and reserve its use solely for those written in XHTML.

Set your first and last <tr> to have colspan="2" so they have the same recognized column count as the second table row. Otherwise it's fine.

I believe it's called XHTML or something when it's XML styling and may need some meta tags, but personally I like the closed tags when they're empty for your error/correct div's below to be <div class="error" /><div class="correct" />, somebody else or a Google could speak to necessity of any doctype tags or other such junk for properly closed tags like that to be recognized as valid by clients.

• Self-closed <div /> tags aren't handled correctly by many browsers even with an XHTML doctype. – Peter Taylor Aug 26 '11 at 6:13

Mostly. According to http://validator.nu/:

Warning: A table row was 2 columns wide and exceeded the column count established by the first row (1).
From line 16, column 18; to line 17, column 13
</td>↩        </tr>↩