cara memeriksa elemen memiliki atribut js
let result = element.hasAttribute(name);
Clever Corncrake
let result = element.hasAttribute(name);