mirror of
https://github.com/bendtherules/UiQuestions.git
synced 2026-08-18 22:02:42 +00:00
create-modify-element - Cleanup setAttribute section
This commit is contained in:
@@ -92,10 +92,12 @@ document.createElement("div")
|
||||
|
||||
### 2. `setAttribute()`
|
||||
|
||||
Every element has a `.setAttribute(name, value)` method, which can add/modify a attribute on the current element.
|
||||
Every element has a `setAttribute` method - which sets a attribute on the current element.
|
||||
|
||||
`name` - the attribute name which should be added. Ex- `"type"`.
|
||||
`value` - value of the attribute. Ex- `"text"`.
|
||||
`setAttribute(name, value)`
|
||||
|
||||
`name` - name of the attribute to add. Ex- "type".
|
||||
`value` - value of the attribute. Ex- "text".
|
||||
|
||||
```js
|
||||
var ele = document.createElement("input")
|
||||
|
||||
Reference in New Issue
Block a user