我可以在HTML元素的name属性中使用空格吗? [英] Can I use white spaces in the name attribute of an HTML element?

查看:404
本文介绍了我可以在HTML元素的name属性中使用空格吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们设计一个网页时,我的项目团队提出了一个问题。
我们可以在HTML元素的name属性中使用白色字符(如空格)吗?例如。 < input type =checkboxname =first check box>



我主要关注我们现在处于设计阶段,直到我们编写一些代码并测试它,很长一段时间才会通过,所以我问你有关这方面的专家。



谢谢!

解决方案

是。



name属性包含 CDATA 。它可以是你喜欢的任何东西。



请注意, name 属性没有NAME标记作为其数据类型(尽管 id 属性没有( id 属性不带ID标记)),所以你不要没有对NAME标记施加限制。


A question has rised in my project team as we are designing a web page. Can we use white characters (like space) in the name attribute of an HTML element ? eg. <input type="checkbox" name="first check box">

My concern is mainly the behavior of different browsers with such an attribute value.

We are now in the design phase, until we get to write some code and test this, a long time will pass, so I am asking you experts about this.

Thank you !

解决方案

Yes.

The name attribute contains CDATA. It can be more or less anything you like.

Note that name attributes do not have NAME tokens as their data type (although the id attribute does (the id attribute doesn't take an ID token)), so you don't have the restrictions imposed on NAME tokens.

这篇关于我可以在HTML元素的name属性中使用空格吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆