下の例だと、指定した要素が一瞬青くなります。
function flashElement (elem) { let indicator = elem.ownerDocument.createElement("div"); let rect = elem.getBoundingClientRect(); indicator.id = "nyantoro-element-indicator"; let style = "background-color: blue; opacity: 0.5; z-index: 999;" + "position: fixed; " + "top: " + rect.top + "px;" + "height:" + elem.clientHeight + "px;"+ "left: " + rect.left + "px;" + "width: " + elem.clientWidth + "px"; indicator.setAttribute("style", style); elem.appendChild(indicator); setTimeout(function () elem.removeChild(indicator), 500); }