File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,14 +124,13 @@ This example will toggle the `data-theme='light'` property on `:root` so we can
124124
125125### Attribute Literals
126126
127- Finally, you can refer to an attribute with two syntaxes :
127+ You can refer to an attribute using the ` @ ` syntax :
128128
129129``` html
130130<div foo =" bar" _ =" on click put @foo into me" >Click Me</div >
131- <div _ =" on click toggle [@foo='bar'] into me" >Click Me</div >
132131```
133132
134- The short syntax, ` @<attribute name> ` can be used to get or set attribute values, and may be chained with
133+ The ` @<attribute name> ` syntax can be used to get or set attribute values, and may be chained with
135134possessives:
136135
137136``` hyperscript
@@ -148,15 +147,15 @@ for anchor in <a/>
148147end
149148```
150149
151- The longer syntax, surrounding the ` @<attribute-name> ` with square brackets, may be used for queries that require a
152- value, or for commands like ` toggle ` or ` add ` that require a value
150+ You can also specify a value with the ` @ ` syntax, which is useful for commands like ` toggle ` or ` add ` :
153151
154152``` hyperscript
155- for anchor in [@href]
156- log anchor@href
157- end
153+ toggle @foo="bar" on me
154+ add @disabled
158155```
159156
157+ > ** Deprecated:** The bracket syntax ` [@foo] ` / ` [@foo="bar"] ` is deprecated. Use ` @foo ` / ` @foo="bar" ` instead.
158+
160159### In Expressions
161160
162161The ` in ` expression isn't a literal, but can be used in conjunction with them for common patterns:
You can’t perform that action at this time.
0 commit comments