GetCss Method (HTMLCONTROL)


10.0A, PLBCMP GUI Only

 

The GetCss method retrieves the style of a HTML element. The method gets the requested style data from the HTML element that has an id attribute that matches the id parameter. This method uses the following format:

 

[label]

{object}.GetCss

[GIVING {return}] USING [*Id=]{id}:

 

 

[*Name=]{name}[,[*Flags=]{flags}]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A HTMLCONTROL that is accessed.

return

Optional. A Character String Variable that returns a string from a HTML element depending on the {name} data type.

Id

Required. A Character String Variable or literal that contains the HTML element id attribute.

name

Required. A Character String Variable or literal that identifies the type of data to be retrieved from the HTML element.

flags

Optional. A Numeric Variable or decimal value that specifies a bit mask value that controls the behavior of this method.

Flags Affected: EOS

Note the following:

  1. CSS is a language that describes the style of an HTML object. This method retrieves a style value from an HTML element contained in a HTMLCONTROL object.

  2. The EOS flag is set if the returned data string is larger than the DIM variable used to receive the data.

  3. The {id} is a value that determines the HTML element used for data retrieval. The {id} string is matched against the id attribute of the HTML element.

  4. The {name} identifies the type of data retrieved from the HTML element matching the {id} string. Information on HTML element CSS style names can be found at:

  5.  

    https://www.w3schools.com/css/

     

  6. If the {name} parameter is unsupported, invalid, or has never been set, an empty string can be returned.

  7. The {flags} parameter is a bitmask value that forces specialized behaviors for the execution of this method.

  8. The {return} string depends on the {name} data type being requested.

Example of GetCss Method:

 

     HtmlControl.GetCss Giving MyValue Using "MyEdit","whiteSpace" 

 

 In this example, the HTML CSS style named "whiteSpace" is retrieved from HTML element with the id attribute of "MyEdit".

 

The MyValue variable returns a string as follows:

 

     pre

 

 

See Also: HTMLCONTROL Method Syntax



PL/B Language Reference GetAttr Method (HTMLCONTROL) MakePict Method (HTMLCONTRL