EN
이 콘텐츠는 한국어로 제공되지 않아 영어 버전으로 표시됩니다.

hasAttribute method

Determines whether an attribute with the specified name exists.

Document Object Model (DOM) Level 3 Core Specification, Section 1.4Internet Explorer 8

 

Syntax

object.hasAttribute(name, pfHasAttribute)

Parameters

name [in]

Type: BSTR

String that specifies the name of the attribute.

pfHasAttribute [out, retval]

Type: Boolean

false (false)

The specified attribute does not exist.

true (true)

The specified attribute exists.

Return value

Type: Boolean

false

The specified attribute does not exist.

true

The specified attribute exists.

Standards information

Remarks

Windows Internet Explorer 8 and later. The hasAttribute method requires IE8 Standards mode and is not supported in IE7 Standards mode or IE5 (Quirks) mode mode. For more information, see Defining Document Compatibility.

The hasAttribute method tests for the existence of an attribute specified by name. The hasAttributes method, on the other hand, determines whether the element has any attributes at all.

See also

a
abbr
acronym
address
applet
area
article
aside
b
base
baseFont
bdo
bgSound
big
blockQuote
body
br
button
caption
center
cite
code
col
colGroup
comment
custom
dd
del
dfn
dir
div
dl
dt
em
embed
fieldSet
figcaption
figure
font
footer
form
frame
frameSet
head
header
hgroup
hn
hr
html
i
iframe
img
input type=button
input type=checkbox
input type=email
input type=file
input type=hidden
input type=image
input type=number
input type=password
input type=radio
input type=range
input type=reset
input type=search
input type=submit
input type=tel
input type=text
input type=url
ins
isIndex
kbd
label
legend
li
link
listing
map
mark
marquee
menu
nav
nextID
noBR
noFrames
noScript
object
ol
option
p
plainText
pre
q
rt
ruby
s
samp
script
section
select
small
span
strike
strong
style
sub
sup
table
tBody
td
textArea
tFoot
th
tHead
title
tr
tt
u
ul
var
wbr
xml
xmp
Reference
getAttribute
hasAttributes

 

 

표시:
© 2014 Microsoft