Как ограничить проверку атрибута тега html? - PullRequest
0 голосов
/ 06 мая 2020

Привет, создайте элемент html, как показано ниже:

image

Когда вы запустите этот код, вы увидите консольную ошибку, как показано ниже:

GET https://stacksnippets.net/fail 404 ( Не найдено)

Есть ли какие-либо предложения по устранению этой ошибки консоли?

1 Ответ

0 голосов
/ 07 мая 2020

я попробовал lke ниже и разрешил мою pblm

 private static removeElement(): void {
         // Removes an element's attibute to avoid html tag validation
         let nodes: HTMLCollection = this.wrapElement.children;
         for (let j: number = 0; j < nodes.length; j++) {
             let attribute: NamedNodeMap = nodes[j].attributes;
             for (let i: number = 0; i < attribute.length; i++) {
                 this.wrapElement.children[j].removeAttribute(attribute[i].localName);
             }
         }
    }
...