File tree 1 file changed +2
-2
lines changed
2-ui/1-document/06-dom-attributes-and-properties
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ Here's an extended demo of working with attributes:
124
124
125
125
elem .setAttribute (' Test' , 123 ); // (2), writing
126
126
127
- alert ( elem .outerHTML ); // (3), see it's there
127
+ alert ( elem .outerHTML ); // (3), see if the attribute is in HTML (yes)
128
128
129
129
for (let attr of elem .attributes ) { // (4) list all
130
130
alert ( ` ${ attr .name } = ${ attr .value } ` );
@@ -260,7 +260,7 @@ Like this:
260
260
for (let div of document .querySelectorAll (' [show-info]' )) {
261
261
// insert the corresponding info into the field
262
262
let field = div .getAttribute (' show-info' );
263
- div .innerHTML = user[field]; // Pete, then age
263
+ div .innerHTML = user[field]; // first Pete into "name" , then 25 into " age"
264
264
}
265
265
</script >
266
266
```
You can’t perform that action at this time.
0 commit comments