View Full Version : Help!? JavaScript does not allow element div

08-22-2011, 01:08 PM
I am using a jQuery slider for a website but the W3C comes up with invalid because:

document type does not allow element "div" here
.before('<div id="buttons">')

<script type="text/javascript">
$(document).ready(function() {
.before('<div id="buttons"></div>')
fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
pager: '#buttons'

Any help with this would be appreciated thanks.

08-22-2011, 01:22 PM
Didn't I already reply to this one?

There is nothing illegal about this javascript string. It is a mistake of the W3C validator to complain about this.

08-22-2011, 01:29 PM
Thanks devnull69,

It doesn't seem to like the <div> tag being inside the javascript, it might be because it is strict instead of transitional.

Sorry if I posted twice I don't know what happened to my other post couldn't see it anywhere.

08-22-2011, 01:45 PM
No, it doesn't have anything to do with strict or transitional. You should either keep the Javascript part out of the validation or ignore the results for the Javascript part.