Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 5fa2d46

Browse files
committed
Updated documentation.
1 parent aab945e commit 5fa2d46

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,23 @@ Include script after the jQuery library (unless you are packaging scripts someho
1616
<script type="text/javascript" src="/path/to/jquery.cascadingdropdown.js"></script>
1717
```
1818

19+
## Usage
20+
21+
To initialize the plugin, simply attach it to the parent group of dropdown elements.
22+
23+
```html
24+
<div id="dropdowns">
25+
<select class="step" name="typeId">
26+
<option value="">Select type</option>
27+
</select>
28+
...
29+
</div>
30+
```
31+
32+
```javascript
33+
$('#dropdowns').cascadingDropdown(options);
34+
```
35+
1936
## Options
2037

2138
#### usePost (boolean)
@@ -200,7 +217,9 @@ Event handler triggered when the dropdown value is changed. The event handler is
200217

201218
Destroys the instance and reverts everything back to their initial state.
202219

203-
$('#dropdown').cascadingDropdown('destroy');
220+
```javascript
221+
$('#dropdown').cascadingDropdown('destroy');
222+
```
204223

205224
<sub>Added: 1.2.7</sub>
206225

0 commit comments

Comments
 (0)