Contents - Index - Top


ElementToggleAttributeByName

Interface AntViewDocument

 

Type: Method

Parameters: String Name String AttrName

Returns: nothing

 

 

Can be used to toggle the boolean attribute identified by AttrName of the html element identified by Name.

By this we mean that the attribute is removed if it exists and added if not present.

The Name is case sensitive and must match the case of the html element.

The attribute name AttrName is automatically converted to lowercase.

 

This triggers the OnElementToggleAttributeByName event on completion as it is an asynchronous operation.

 

Note that multiple elements can match the name passed. If this is the case then only the first element that matches the name will be set.

 

There's also a synchronous alternative ElementToggleAttributeByNameSync that wraps the property and event into one call. This gives you the possibility to immediately check the result after executing the method.

 

See also: RequestElementAttributeByName, SetInputCheckboxByName

 

Example: 

Fill Form Example

 

Introduced in AntView release 1.1.354

 


AntView - The MS Edge WebView2 ActiveX control Date last changed: 09/30/2024