ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / Properties associated with windows, pages and controls
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
The HTMLAttribute property reads and changes the HTML attributes of the control.
Remarks:
  • The HTML attributes of the control change its behavior to store specific additional information ("data-" attributes), add accessibility information ("aria-" attributes), etc.
    At runtime, the initial values of this property are the attributes defined in edit mode.
  • In the editor, the HTML attributes are defined in the "Advanced" tab of the control description window.
Example
// Disables the spelling checker on the control
EDT_Edit.HTMLAttribute["spellcheck"] = "false"
Syntax

Reading the value of the HTML attribute Hide the details

<Result> = <Control>.HTMLAttribute[<Attribute>]
<Result>: Expected type
Value of the attribute.
<Control>: Control name
Name of the control used.
<Attribute>: Character string
Name of the attribute whose value is to be read.

Changing the value of the HTML attribute Hide the details

<Control>.HTMLAttribute[<Attribute>] = <Value>
<Control>: Control name
Name of the control used.
<Attribute>: Character string
Name of the attribute whose value is to be changed.
<Value>: Attribute type
New value of the attribute.
Remarks
  • Names and values are encoded properly before being written to the page.
  • If an attribute is added elsewhere in the WEBDEV editor (e.g. to make sure a control works properly), both will be included in the HTML code, but the one defined with the HTMLAttribute property will take precedence. However, the resulting HTML code will not be validated and the page may not be properly displayed in the browser.
  • Names and values are not checked. If an invalid name or value is used, the page may not be properly displayed in the browser.
  • To remove an attribute, use the following syntax:
    <Control>.HTMLAttribute[<Attribute name>].Delete()
  • To define an attribute without a value, use the following syntax:
    <Control>.HTMLAttribute[<Attribute name>] = Null
Minimum version required
  • Version 28
Comments
Click [Add] to post a comment

Last update: 01/10/2025

Send a report | Local help