setAttributeの読み方

setAttributeの読み方

javascriptで利用されるメソッドの1つである「setAttribute」の読み方を掲載してます。

読み⽅

セット・アトリビュート」と読みます。

英訳

「Attribute」は「属性」という意味があります。

setAttributeとは

javascriptで、属性を作成することができます。

const elm = document.getElementById('id名');
 
elm.setAttribute("width", "300");
elm.setAttribute("height", "300");

setAttributeの使い方はこちら