The W3C returns an error on my xHTML (1.0 strict) code concerning this select form (I use it for a dropdown navigation menu) :
<select name="url" onchange="document.location.href = this.value>
here is the error message :
document type does not allow element “select” here; missing one of “p”, “h1”, “h2”, “h3”, “h4”, “h5”, “h6”, “div”, “pre”, “address”, “fieldset”, “ins”, “del” start-tag
The mentioned element is not allowed to appear in the context in which you’ve placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you’ve forgotten to close a previous element.
One possible cause for this message is that you have attempted to put a block-level element (such as “< p>” or “”) inside an inline element (such as “”, “”, or “”).
Any clue on how should I write it to be OK with the W3C ?
Thank you !
From looking around the internet, it sounds like
<Select>is an inline element that needs to be within a block element like<p>or<div>. See the example here.