diff --git a/DOM-Content.md b/DOM-Content.md new file mode 100644 index 0000000..b1dc533 --- /dev/null +++ b/DOM-Content.md @@ -0,0 +1,90 @@ +* [`html`](#usage-html) | [`text`](#usage-text) | [`load`](#usage-load) + +--- + +## .html + +**Description** +Gets the HTML contents of the first element in the set, or sets the HTML contents of every matched element. + +🛡️ **Security by Default:** When setting HTML, jBase automatically strips dangerous inline event handlers (like `onerror`) and malicious protocols (like `href="javascript:..."`) to mitigate XSS attacks. Embedded `', { executeScripts: true }); +``` + +--- + +## .text + +**Description** +Get the combined text contents of each element in the set of matched elements, including their descendants, or set the text contents of the matched elements. + +**Parameters** + +* `content` (String, optional): The text to set. + +**Returns** + +* (String): Text content (if getter). +* (jBase): Current instance (if setter). + +**Example** + +```javascript +$('h1').text('Welcome to jBase'); + +``` + +--- + +## .load + +**Description** +Loads HTML content from a server and automatically injects it into the matched elements. This is an asynchronous wrapper utilizing `$.http.getText()`. + +🛡️ **Security by Default:** When setting HTML, jBase automatically strips dangerous inline event handlers (like `onerror`) and malicious protocols (like `href="javascript:..."`) to mitigate XSS attacks. Embedded `