From 8eebb13b6be0d115f9b00d18d9b53cba9f76feda Mon Sep 17 00:00:00 2001 From: caharkness Date: Thu, 27 Feb 2025 14:31:29 -0700 Subject: [PATCH] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 21a38bc..862ae72 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ A JavaScript and CSS library for augmenting raw HTML inputs with modern search f * Support for locally rendered options and options returned via a GET request -###### Usage +###### Basic Usage Include both the `SearchableInput.js` and `SearchableInput.css` files in your page's source and wrap any text input like the following: @@ -25,6 +25,8 @@ Include both the `SearchableInput.js` and `SearchableInput.css` files in your pa +###### Shared Item Source + If multiple inputs require the same source of data, put your `div.item` options in a hidden div somewhere in the document accessible by its `id` attribute:
@@ -40,6 +42,8 @@ Then, in the `div.items` container beneath the input, set its `data-source` attr
+###### Items from GET (application/json) + Alternatively, you can set the `data-source-api` to access a GET endpoint that responds with `application/json`: