Sets the value of the named attribute on the element.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
An attribute in HTML is any valid name-value pair for that element. HtmlElement exposes only those attributes that are common to all elements, leaving out those that only apply to certain types of elements; SRC is a predefined attribute for the IMG tag, for example, but not for the DIV tag. Use GetAttribute and to manipulate attributes not exposed on the managed Document Object Model (DOM).
If attributeName is not a defined attribute on an element, will define it on the element as a new attribute.
GetAttribute and are case-insensitive.
To set the class attribute on an HtmlElement , you must refer to the attribute as className when specifying the first argument to
The following code example adds a new IMG element to the current document, using to set the SRC attribute for the image.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.