Expand Minimize

hasAttribute method

Determines whether an attribute with the specified name exists.

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

Syntax

object.hasAttribute(name, pfHasAttribute)

Parameters

name [in]

Type: String

String that specifies the name of the attribute.

Return value

Type: Boolean

false

The specified attribute does not exist.

true

The specified attribute exists.

Standards information

Remarks

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
address
area
article
aside
b
base
bdo
bgSound
blockQuote
body
br
button
caption
cite
code
col
colGroup
comment
custom
dd
del
dfn
div
dl
dt
em
embed
fieldSet
figcaption
figure
footer
form
frame
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
kbd
label
legend
li
link
map
mark
menu
nav
object
ol
option
p
pre
q
rt
ruby
s
samp
script
section
select
small
span
strong
style
sub
sup
table
tBody
td
textArea
tFoot
th
tHead
title
tr
u
ul
var
Reference
getAttribute
hasAttributes

 

 

Show:
© 2014 Microsoft