M
Mechphisto
I've a JS script I'm using:
<script type="text/javascript">
function showS(ind){
var sel =
document.getElementById('container').getElementsByTagName('div');
for(var i=0;i<sel.length;i++){
sel.style.display=(i==ind)?'block':'none';
}
}
onload = function(){showS(0)};//
document.form_event_sel.sel_event_type.selectedIndex = 0;
</script>
But when I W3C validate my page, I get the error:
start tag was here
for(var i=0;i<sel.length;i++){
and it underlines the less-than symbol in the FOR line.
And then this error:
character ";" not allowed in attribute specification list
for(var i=0;i<sel.length;i++){
and it underlines the semicolon after "length".
I think this is the root of all my other validation errors that go:
error parsing attribute name
for(var i=0;i<sel.length;i++){
underlying the "h" in the word "length" and
Opening and ending tag mismatch: body line 76 and form
</form>
and all the other supposed tag mismatches. I think all because somehow
it's thinking that less-than symbol in the JS FOR line is an opening
of a tag.
Any suggestions on what I can do to reformulate that line to fix that?
Thanks,
Liam
<script type="text/javascript">
function showS(ind){
var sel =
document.getElementById('container').getElementsByTagName('div');
for(var i=0;i<sel.length;i++){
sel.style.display=(i==ind)?'block':'none';
}
}
onload = function(){showS(0)};//
document.form_event_sel.sel_event_type.selectedIndex = 0;
</script>
But when I W3C validate my page, I get the error:
start tag was here
for(var i=0;i<sel.length;i++){
and it underlines the less-than symbol in the FOR line.
And then this error:
character ";" not allowed in attribute specification list
for(var i=0;i<sel.length;i++){
and it underlines the semicolon after "length".
I think this is the root of all my other validation errors that go:
error parsing attribute name
for(var i=0;i<sel.length;i++){
underlying the "h" in the word "length" and
Opening and ending tag mismatch: body line 76 and form
</form>
and all the other supposed tag mismatches. I think all because somehow
it's thinking that less-than symbol in the JS FOR line is an opening
of a tag.
Any suggestions on what I can do to reformulate that line to fix that?
Thanks,
Liam