ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / Properties associated with windows, pages and controls
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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 used>: Control name
Name of the control used.
<Attribute>: Character string
Name of the attribute whose value is be changed.
<Control>: Control name
Name of the control used.
<Value>: Type of the attribute
New value of the attribute.
Remarks
  • Names and values are encoded properly before being written to the page.
  • If an attribute is added in the WEBDEV editor (to make sure the control behaves properly): both will be included in the HTML code: 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: 10/03/2023

Send a report | Local help