offline version v3


⊗jsPmAtStM 366 of 502 menu

Setting of attributes in JavaScript

setAttribute

Given an element:

<input id="elem">

Set its value attribute to 'text'.

Given an element:

<input id="elem">

Set its class attribute to 'valid'.

enru