Common properties or methods
In the $
instance, in addition to selecting elements with selectors, there are also some commonly used methods provided to facilitate element manipulation and searching.
You can take a brief look at it, and refer to the API documentation whenever needed in the future.
Common Properties
- tag: Get the tag name of the target.
- ele: Get the actual native element of the instance.
- index: Get the index of the target element under its parent element.
- text: Get or set the text of the target element.
- html: Get or set the HTML code of the target element.
- css: Get or set the style of the target element.
- style: Get the native style of the target element.
- classList: Get the native class list of the target element.
- data: Get the native dataset of the target element.
Node Operations
- before: Add elements before the target instance.
- after: Add elements after the target instance.
- remove: Remove the target element.
- attr: Get or set the attributes of the target element.
Key Features
- Form Data: Conveniently bind and retrieve form data
If you want to learn more about the API of ofa.js, you can refer to the API documentation.