.attr - OtagJS/Otag GitHub Wiki

.attr( {attribution:value} Object )

.attr( attribution String, value anyting )

Defines properties to an Element

There are two types of use; single or multi attribution definition

Usage

//multi attribute definition
let Elem='input'.attr({
	type:'button',
    else:'something'
});

//single attribute definition
let Elem='input'.attr('type','button');

O.ready.then(b=>b.append(Elem));

Differance from .prop

Elements are gettable by .attr

<input type="button"/>

While we can affect to this element via CSS,

input[type="button"]{
	padding:3px 7px;
}

we can also get this element from page

'input[type="button"]'.get() // Array[ input,input.. ]

Further reading for example above see: String.get