getElementsByClassName method

Gets a collection of objects that are based on the value of the class attribute.

HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 3.1.1

Syntax

object.getElementsByClassName(v)

Parameters

v [in]

Type: String

A String value that specifies the value of a class attribute.

Return value

Type: Element

Returns a collection of objects with the same class attribute value.

Standards information

Remarks

To search for multiple class attribute values, separate them with spaces in the v parameter.

See also

a
abbr
address
area
article
aside
audio
b
base
bdo
bgSound
blockQuote
body
br
button
canvas
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
media
menu
meta
nav
object
ol
optGroup
option
p
param
pre
q
rt
ruby
s
samp
script
section
select
small
source
span
strong
style
sub
sup
table
tBody
td
textArea
tFoot
th
tHead
title
tr
u
ul
var
video

 

 

Show:
© 2014 Microsoft