diff --git a/script/aria.js b/script/aria.js
index 0ad35db..385411e 100644
--- a/script/aria.js
+++ b/script/aria.js
@@ -85,28 +85,20 @@ function ariaAttributeReferences() {
});
if (!skipIndex) {
- // we have all the properties and states - spit out the
- // index
- let propIndex = "";
-
- for (let item of Object.values(propList)) {
- propIndex +=
- '
' +
- item.name +
- "\n";
- propIndex += "" + item.desc + "\n";
- }
- let node = document.getElementById("index_state_prop");
- parentNode = node.parentNode;
- let l = document.createElement("dl");
- l.id = "index_state_prop";
- l.className = "compact";
- l.innerHTML = propIndex;
- parentNode.replaceChild(l, node);
+ // Generate index of states and properties
+ const indexStatePropPlaceholder =
+ document.getElementById("index_state_prop");
+ const indexStatePropContent = Object.values(propList)
+ .map(
+ (item) =>
+ `${item.name}\n${item.desc}\n`
+ )
+ .join("");
+ indexStatePropPlaceholder.insertAdjacentHTML(
+ "afterend",
+ `${indexStatePropContent}
`
+ );
+ indexStatePropPlaceholder.remove();
let globalSPIndex = "";
for (let lItem of globalSP) {