Add JavaScript questions (#4505)
* Add Javascript questions * wip: add more questions * wip: add ternary operator * wip: add more questions * wip: add more questions * wip: add more questions * wip: add more questions * fix: set example * wip: add more questions * wip: add more question * wip: add more questions * wip: add more questions * wip: add more questions * wip: add more questions * wip: add more questions * wip: add more questions * wip: add more questions * wip: add another question * wip: add more questions * wip: add more questions * wip: add more questions * wip: add more questions * wip: add more questions * wip: add more questions * wip: add more questions * wip: add more questions
This commit is contained in:
1 parent
485ca9dd8f
commit
abbeb717d1
52 files changed
+1475
No files matched your search
@@ -0,0 +1,9 @@
|
||||
To create a new DOM element, you can use the `document.createElement` method. It accepts a tag name as an argument and returns a new element with the specified tag name. You can set attributes to the element.
|
||||
|
||||
```js
|
||||
const div = document.createElement('div');
|
||||
|
||||
div.id = 'roadmap-wrapper';
|
||||
div.setAttribute('data-id', 'javascript');
|
||||
console.log(div); // <div id="roadmap-wrapper" data-id="javascript"></div>
|
||||
```
|
||||
Reference in new issue
Block a user