MCPcopy Create free account
hub / github.com/ampproject/amphtml / setAttribute

Function setAttribute

test/unit/test-fixed-layer.js:317–328  ·  view source on GitHub ↗
(name, value)

Source from the content-addressed store, hash-verified

315 return null;
316 },
317 setAttribute(name, value) {
318 if (name.includes('[')) {
319 throw new Error('invalid characters');
320 }
321 for (let i = 0; i < this.attributes.length; i++) {
322 if (this.attributes[i].name === name) {
323 this.attributes[i].value = value;
324 return;
325 }
326 }
327 this.attributes.push(new FakeAttr(name, value));
328 },
329 removeAttribute(name) {
330 for (let i = 0; i < this.attributes.length; i++) {
331 if (this.attributes[i].name === name) {

Callers

nothing calls this directly

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected