refactor: Improve for...of
This commit is contained in:
parent
afcb06a808
commit
e698161a2d
2 changed files with 7 additions and 7 deletions
|
|
@ -192,13 +192,13 @@ function composeMail(tag, name, prov, suffix, text, topic) {
|
|||
el.innerHTML = elContent + text;
|
||||
el.setAttribute('href', 'mailto:' + mailString + topic);
|
||||
} else {
|
||||
const els = document.getElementsByClassName(tag.slice(1));
|
||||
const elements = document.getElementsByClassName(tag.slice(1));
|
||||
|
||||
for (let el of els) {
|
||||
const elContent = el.innerHTML;
|
||||
for (const element of elements) {
|
||||
const content = element.innerHTML;
|
||||
|
||||
el.innerHTML = elContent + text;
|
||||
el.setAttribute('href', 'mailto:' + mailString + topic);
|
||||
element.innerHTML = content + text;
|
||||
element.setAttribute('href', 'mailto:' + mailString + topic);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue