i’m using
<script type="text/javascript" >
document.write("<marquee scrollamount='5' onMouseOver='this.stop()' onMouseOut='this.start()'><img alt='ibm' src='images/ibm.png' width='100px' height='100%' /><img alt='tcs' src='images/tcs.jpg' width='100px' height='100%' /><img alt='hp' src='images/hp.png' width='100px' height='100%' /><img alt='hcl' src='images/hcl.jpg' width='100px' height='100%' /><img alt='cts' src='images/cts.jpg' width='100px' height='100%' /><img alt='accenture' src='images/Accenture.png' width='100px' height='100%' /></marquee>");
</script>
for marquee picture in my website, but when i’m checking my webpage into W3 Validator
, then i’m getting error on the above code.
- element “marquee” undefined
- there is no attribute “onMouseOver”
- there is no attribute “scrollamount”
- there is no attribute “onMouseOut”
Need help to solve the above problem !!
The problems are explained in your question.
marqueeis an old Microsoft thing and it should not be used.onMouseOveris also not a defined attribute. You could useonmouseover, but rather, use unobtrusive event handlers.Some bonus tips…
document.write()or themarqueeelement in this day and age. Both can be achieved using more elegant and powerful means in JavaScript.imgelementswidthandheightattributes should never includepx.typeattribute is no longer required onscriptelements if the script type istext/javascript.