img名称或ID [英] img name or ID

查看:78
本文介绍了img名称或ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说在HTML 4.01严格中不推荐使用name属性。是否建议您使用图像的ID属性以及

getElementById方法而不是旧方法?
谢谢。

I heard that the name attribute is deprecated in html 4.01 strict. Is it
recommended that you use the ID attribute for images along with the
getElementById method instead of the old way? Thanks.

推荐答案

我不知道它是否被弃用了,因为存在一个
$ b $让我感到惊讶b全球收藏

document.images

该集合由数字索引或NAME属性处理:

document.images [" mygifName" ] .src

这就是为什么如果它被删除它会让我感到惊讶。但是所有的东西都可以...... / b $ b是可能的......!


然而,当然getElementById需要一个ID =某事。

当然,你可以在图像中使用name =和id = - 要利用的名称

document.images集合,getElementById的id,或者让我们说,

dhtml

ciao

Alberto Vallini
http://www.unitedscripters.com/

" TheKeith" < no@spam.com> ha scritto nel messaggio

新闻:JY ******************** @ giganews.com ...
I don''t know if it is deprecated, it surprises me a bit for there exist a
global collection
document.images
That collection is addressed by numerical indexes or by NAME properties:
document.images["mygifName"].src
this is why if it has been deprectaed it would surprise me. yet everything
is possible...!

Yet, of course getElementById requires an ID="something".
Of course, you can use both name= and id= in an image - the name to exploit
the document.images collection, the id for getElementById or, let''s say,
dhtml
ciao
Alberto Vallini
http://www.unitedscripters.com/

"TheKeith" <no@spam.com> ha scritto nel messaggio
news:JY********************@giganews.com...
我听说在HTML 4.01严格中不推荐使用name属性。是否建议您使用图像的ID属性以及
getElementById方法而不是旧方法?谢谢。
I heard that the name attribute is deprecated in html 4.01 strict. Is it
recommended that you use the ID attribute for images along with the
getElementById method instead of the old way? Thanks.



> From:" TheKeith" no@spam.com
>From: "TheKeith" no@spam.com
我听说html 4.01 strict中不推荐使用name属性。是否建议您使用图像的ID属性以及
getElementById方法而不是旧方法?谢谢。
I heard that the name attribute is deprecated in html 4.01 strict. Is it
recommended that you use the ID attribute for images along with the
getElementById method instead of the old way? Thanks.




我刚验证了一个页面,html4.01严格,在

img标签中有名称属性,并且验证正常。所以我怀疑它被弃用了。如果有,

那么w3c的验证器是错的。

-

Randy



I just validated a page, with html4.01 strict, that has name attributes in the
img tags and it validated fine. So I doubt that its been deprecated. If it has,
then the validator at w3c is wrong.
--
Randy



" HikksNotAtHome" <喜************ @ aol.com>在消息中写道

news:20 *************************** @ mb-m27.aol.com。 ..

"HikksNotAtHome" <hi************@aol.com> wrote in message
news:20***************************@mb-m27.aol.com...
From:" TheKeith" no@spam.com
From: "TheKeith" no@spam.com
我听说在HTML 4.01严格中不推荐使用name属性。是否建议您使用图像的ID属性以及
getElementById方法而不是旧方法?谢谢。
I heard that the name attribute is deprecated in html 4.01 strict. Is it
recommended that you use the ID attribute for images along with the
getElementById method instead of the old way? Thanks.



我刚验证了一个页面,用html4.01严格,在



I just validated a page, with html4.01 strict, that has name attributes in

中有名称属性

img标签并且验证正常。所以我怀疑它被弃用了。如果
有,那么w3c的验证器是错误的。


the img tags and it validated fine. So I doubt that its been deprecated. If it has, then the validator at w3c is wrong.



是的,我验证了图像中有图像属性的图像映射。我猜你错了这个 - 我不记得我听到了什么。


Yeah I validated an image map where the image has a name attribute in it. I
guess I''m wrong about this one--can''t remember where I heard it.


这篇关于img名称或ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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