Attribute | Sololearn: Learn to code for FREE!

+11

Attribute

How can I create a attribute to an new element in JavaScript?

12/19/2018 1:07:47 PM

Roopesh

2 Answers

New Answer

+6

use createAttribute https://www.w3schools.com/jsref/met_document_createattribute.asp setAttribute https://www.w3schools.com/jsref/met_element_setattribute.asp