Contents - Index - Top


ElementToggleAttributeById

Interface AntViewDocument

 

Type: Method

Parameters: String Id String AttrName

Returns: nothing

 

 

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

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

The html element is identified by Id.

Note that the Id is case sensitive and must match the case of the html element.

The attribute name AttrName is automatically converted to lowercase.

 

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

 

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

 

See also: RequestElementAttributeById, SetInputCheckboxById

 

Example: 

Fill Form Example

 

Introduced in AntView release 1.1.354

 


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