File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -1082,12 +1082,27 @@ display(paragraphs.html)
1082
1082
The example above displays a list with the value of the ` html ` attribute for all the elements in the
1083
1083
` paragraphs ` collection.
1084
1084
1085
- The same way we can read attributes, we can also set an attribute directly in the collection. For instance:
1085
+ The same way we can read attributes, we can also set an attribute directly in the collection. For instance,
1086
+ you can directly set the html content of all the elements in the collection
1086
1087
1087
1088
``` python
1088
- paragraphs.html = " That's cool :)"
1089
+ # This will change the text of all H1 elements in the page
1090
+ pydom[' h1' ].html = " That's cool :)"
1089
1091
```
1090
1092
1093
+ or perhaps change their style
1094
+
1095
+ ```
1096
+ paragraphs.style['background-color'] = 'lightyellow'
1097
+ ```
1098
+
1099
+ ` ElementCollection ` currently support the following attributes:
1100
+
1101
+ * ` style ` : just like in ` Element ` , this proxy attribute can be used to change the style of the elements in
1102
+ a collection by setting the proper CSS rules, using ` style ` with the same API as a dictionary.
1103
+ * ` html ` : allows to change the ` html ` attribute on all the elements of a collection.
1104
+ * ` value ` : allows to change the ` value ` attribute on all the elements of a collection.
1105
+
1091
1106
1092
1107
## Workers
1093
1108
You can’t perform that action at this time.
0 commit comments