Skip to content

Commit

Permalink
Tip about ignoring call chains on missing elements.
Browse files Browse the repository at this point in the history
  • Loading branch information
gnat authored Mar 1, 2024
1 parent faa3b6c commit 79f5eea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ me().on("click", async event => {
* Or, use a relative start.
* ▶️ `<input type="text" n1 /> <script>me('[n1]', me()).value = "hello"</script>`

#### Ignore call chain when element is missing.
* ▶️ `me("#i_dont_exist")?.classAdd('active')`
* Silence console warning: ▶️ `me("#i_dont_exist", document, false)?.classAdd('active')`

## <a name="plugins"></a>🔌 Your own plugin

Feel free to modify Surreal for a project any way you like- but you can use plugins to effortlessly merge functions with new versions.
Expand Down

0 comments on commit 79f5eea

Please sign in to comment.