레퍼런스 setAttribute()

setAttribute()

Sets an attribute to a given value.

The first parameter, name, is a string with the name of the attribute being set.

The second parameter, value, is the attribute's new value. For example, calling myXML.setAttribute('id', 123) sets the id attribute to the value 123.

예제

구문

setAttribute(name, value)

매개변수

name
String:

name of the attribute to be set.

value
Number|String|Boolean:

attribute's new value.

Notice any errors or typos? Please let us know. Please feel free to edit src/io/p5.XML.js and open a pull request!

관련 레퍼런스