在 Javascript 中关闭 img 标签时遇到问题 ߝ使用严格的 xhtml DTD
我正在使用名为 Niceforms.js 的 Javascript,它使 HTML 表单看起来很漂亮。它在 xHTML Transitional Doctype 下工作正常,但我需要使用严格的 xHTML 构建我的网站。
它在严格下渲染时存在一些问题,我相当确定这是因为它没有将尾部斜杠放在一些 元素中,以便它们是
.以下是创建
标签的代码。我怎样才能让它输出尾部斜杠?
el.topLeft = document.createElement('img');
el.topLeft.src = imagesPath + "0.png";
el.topLeft.className = "NFTextareaTopLeft";
我希望这些代码足以提供帮助。我对 Javascript 不太有经验。
如果有帮助的话,可以在这里下载整个脚本... http://www.emblematiq.com/lab/niceforms/download/
谢谢你提前! 皮特
I am using a Javascript called Niceforms.js which makes HTML forms looks pretty. It works fine under the xHTML Transitional Doctype, but I need to build my site using Strict xHTML.
It has a few problems rendering under Strict and I'm fairly sure it's because it isn't putting the trailing slash in a few <img>
elements so that they are <img ... />
. Here is the code that is creating the <img>
tags. How can I get it to output the trailing slash?
el.topLeft = document.createElement('img');
el.topLeft.src = imagesPath + "0.png";
el.topLeft.className = "NFTextareaTopLeft";
I hope this is enough of the code to help. I am not very experienced with Javascript.
The whole script can be downloaded here if it helps...
http://www.emblematiq.com/lab/niceforms/download/
Thank you in advance!
Pete
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论