UNPKG

apex4x

Version:

The Comprehensive ARIA Development Suite

62 lines 3.33 kB
�� Function: createElement(stringTagName, attributesKeyValueMap, stylesKeyValueMap, stringClassName, stringOrElementNodesToInsert) Shorthand: create(stringTagName, attributesKeyValueMap, stylesKeyValueMap, stringClassName, stringOrElementNodesToInsert) Description: Creates a DOM element with supplemental parameters. Returns: domElement. Note: The createElement() function does not support chaining. Example: // Create a new element with tag name. var myElement = $A.createElement("button"); // Create a new element with tag name plus attributes. var myElement = $A.createElement("button", { // Attributes "aria-label": "Settings", "aria-expanded": "false" }); // Create a new element with tag name, attributes, plus style properties. var myElement = $A.createElement("button", { // Attributes "aria-label": "Settings", "aria-expanded": "false" }, { // Styles position: "absolute", "margin-left": -50px }); // Create a new element with tag name, attributes, style properties, pluss class names. var myElement = $A.createElement("button", { // Attributes "aria-label": "Settings", "aria-expanded": "false" }, { // Styles position: "absolute", "margin-left": -50px }, // Class Names "accordion heading"); // Create a new element with tag name, attributes, style properties, class names, plus content. var myElement = $A.createElement("button", { // Attributes "aria-label": "Settings", "aria-expanded": "false" }, { // Styles position: "absolute", "margin-left": -50px }, // Class Names "accordion heading", // Content '<span class="arrow-icon"></span>');