是否已弃用name属性? [英] Has the name attribute deprecated?

查看:506
本文介绍了是否已弃用name属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否弃用了name属性?


我问这个是因为ASP.NET 2警告我不要使用它,说它已经弃用了
并且在创建收音机时没有使用它(在客户端上)

按钮列表。


我一直认为HTML单选按钮列表是由给所有

按钮名称相同但ID不同?


这里发生了什么?

解决方案

Jasbird写道:


是否已弃用name属性?



name属性有悠久而复杂的历史记录。对于各种不同版本的HTML中的各种不同元素,它已经存在了




HTML 4.01将name属性添加到一些没有它的元素中
HTML 4.0中的



XHTML 1.0弃用了小程序,表格,框架的名称属性,

iframe,img和地图元素。但不适用于按钮,textarea,选择,

输入,对象,参数和元元素。


XHTML 1.1完全从a和map元素中删除它。


我问这个是因为ASP.NET 2警告我不要使用它,说它已经弃用了
并且没有使用它(在客户端)创建收音机时

按钮列表。



你的代码试图生成什么版本的(X)HTML?


我一直认为一个HTML单选按钮列表是通过给所有

按钮提供相同名称但不同的ID?



差不多。相同的名称,不同的值。收音机不需要ID

按钮。


史蒂夫


.. OO(史蒂夫普格)

个Jasbird写道:

个我一直认为一个HTML单选按钮列表是通过给所有按钮命名相同但ID不同的按钮制作的?


差不多。相同的名称,不同的值。收音机
按钮不需要ID。



如果你使用标签元素你需要它们。


Micha


迈克尔Fesser写道:

.oO(史蒂夫普格)

Jasbird写道:<无线电通信/>


我一直认为HTML单选按钮列表是通过给所有

按钮命名相同但ID不同的按钮制作的?



差不多。相同的名称,不同的值。收音机不需要ID

按钮。



如果使用标签元素,则需要它们。



< label>是这样的吗? < input name =" so"类型= QUOT;无线电"值= [否" />< / label>

如果您使用明确关联的标签元素(IE6理解的唯一

排序),则需要它们。对于隐含关联的标签,他们不需要



Steve


Has the name attribute deprecated?

I ask this because ASP.NET 2 warns me against using it, says that it has
been deprecated and doesn''t use it (on the client) when creating a radio
button list.

I always thought that a HTML radio button list was made by giving all
the buttons the same name but different IDs?

What''s going on here?

解决方案

Jasbird wrote:

Has the name attribute deprecated?

The name attribute has a long and complicated history. It has existed
for various different elements in various different versions of HTML.

HTML 4.01 adds the name attribute to some elements which didn''t have it
in HTML 4.0.

XHTML 1.0 deprecates the name attribute for a, applet, form, frame,
iframe, img, and map elements. But not for button, textarea, select,
input, object, param and meta elements.

XHTML 1.1 removes it entirely from a and map elements.

I ask this because ASP.NET 2 warns me against using it, says that it has
been deprecated and doesn''t use it (on the client) when creating a radio
button list.

What version of (X)HTML is your code trying to produce?

I always thought that a HTML radio button list was made by giving all
the buttons the same name but different IDs?

Nearly. Same name, different values. IDs are not required for radio
buttons.

Steve


..oO(Steve Pugh)

>Jasbird wrote:

>I always thought that a HTML radio button list was made by giving all
the buttons the same name but different IDs?


Nearly. Same name, different values. IDs are not required for radio
buttons.

You need them if you use label elements.

Micha


Michael Fesser wrote:

.oO(Steve Pugh)

Jasbird wrote:

I always thought that a HTML radio button list was made by giving all
the buttons the same name but different IDs?

Nearly. Same name, different values. IDs are not required for radio
buttons.


You need them if you use label elements.

<label>Is that so? <input name="so" type="radio" value="no" /></label>

You need them if you use explicitly associated label elements (the only
sort that IE6 understands). For implicitly associated labels they are
not needed.

Steve


这篇关于是否已弃用name属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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