Skip to content

Commit 01e59d7

Browse files
committed
Add documentation about arg passed to onchange
Add documentation to readme to explain that the onchange callback receives the new step element (targetElement) as an argument
1 parent cc7f830 commit 01e59d7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ introJs().onexit(function() {
198198
###introJs.onchange(providedCallback)
199199

200200
Set callback to change of each step of introduction. Given callback function will be called after completing each step.
201+
The callback function receives the element of the new step as an argument.
201202

202203
**Available since:** v0.3.0
203204

@@ -209,8 +210,8 @@ Set callback to change of each step of introduction. Given callback function wil
209210

210211
**Example:**
211212
```javascript
212-
introJs().onchange(function() {
213-
alert("new step");
213+
introJs().onchange(function(targetElement) {
214+
alert("new step: " + targetElement);
214215
});
215216
````
216217

0 commit comments

Comments
 (0)