Home Cooker Classes Others Rice CookerGX
Classes  >  element  >  GetAttribute(string)
element class : GetAttribute(string) method

Description

Gets a value of the specified attribute.

Syntax

elementInstance.GetAttribute(string attributeName)

Arguments

ClassNameDescription
stringattributeNameAn attribute name.

Return value

ClassDescription
stringAn attribute value.

Sample code

//anyElement is any instance of element type.

string attributeName = "class"

string attributeValue = anyElement.GetAttribute(attributeName);

Notes

It's a wrapper of the MSHTML.IHTMLElement5.getAttribute(String).

If the specified attribute does not exist within the invoker element, returns an empty string.

Links for reference

Copyright © Rice All rights reserved.