You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reflexes.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ StimulusReflex makes the following properties available to the developer inside
60
60
*`request.post` - If the page contains a form, this will find the closest form.
61
61
*`session` - the Django session store for the current visitor
62
62
*`url` - the URL of the page that triggered the reflex
63
-
*`element` - a dictionary like object that represents the HTML element that triggered the reflex
63
+
*`element` - an object that represents the HTML element that triggered the reflex
64
64
*`params` - Contains the form parameters for the closest form
65
65
66
66
## Methods
@@ -74,7 +74,7 @@ StimulusReflex makes the following properties available to the developer inside
74
74
75
75
### `element`
76
76
77
-
The `element` property contains all of the Reflex controller's [DOM element attributes](https://developer.mozilla.org/en-US/docs/Web/API/Element/attributes) as well as other properties like, `tagName`, `checked` and `value`.
77
+
The `element` property contains all of the Reflex controller's [DOM element attributes](https://developer.mozilla.org/en-US/docs/Web/API/Element/attributes) as well as other properties like, `tag_name`, `checked` and `value`.
78
78
79
79
{% hint style="info" %}
80
80
**Most values are strings.** The only exceptions are `checked` and `selected` which are booleans.
@@ -98,17 +98,17 @@ from sockpuppet.reflex import Reflex
98
98
99
99
classExampleReflex(Reflex):
100
100
defwork(self):
101
-
self.element['id']#the HTML element's id attribute value
101
+
self.element.attributes# a dictionary that represents all attributes of the HTML element
102
102
self.element.dataset # a dictionary that represents the HTML element's dataset
0 commit comments