Javascript 如何在xhtml中使用字幕标记
我正在使用Javascript 如何在xhtml中使用字幕标记,javascript,xhtml,validation,marquee,Javascript,Xhtml,Validation,Marquee,我正在使用 <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
<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>
文件。填写(“”);
用于我网站中的字幕图片,但当我将我的网页签入
,那么我得到了上面代码的错误
- 元素“marquee”未定义
- 没有“onMouseOver”属性
- 没有“scrollamount”属性
- 没有“onMouseOut”属性
需要帮助才能解决上述问题 你的问题中解释了这些问题
是微软的老东西,不应该使用它marquee
也不是定义的属性。您可以在mouseover上使用onMouseOver
,但可以使用不引人注目的事件处理程序onmouseover
- 其他问题可以用上述内容来解释
- 在当今时代,使用
或document.write()
元素的原因很少。这两种方法都可以使用JavaScript中更优雅、更强大的手段来实现marquee
元素img
和width
属性不应包括height
px
- 如果您使用的是HTML5 doctype,如果脚本类型为
,则text/javascript
属性不再需要在type
元素上使用script