I am new in javascript. I would like to store svg.class
value in variable and new to create new function.
For example below, the svg.class
value is overline
need to store in $overline=overline and need to create the function name like function newoverline()
. How to achive this?
My html looks like below:
<span class="mord accent">
<span class="vlist-t">
<span class="vlist-r">
<span class="vlist" style="height: 1.20533em;">
<span class="mord">
<span class="mord mathdefault">A</span>
</span>
<span class="svg-align" style="top: -3.68333em;">
<span class="stretchy" style="height: 0.522em; min-width: 0.888em;">
<span class="halfarrow-left" style="height: 0.522em;">
<svg width="400em" height="0.522em" class="overline" viewBox="0 0 400000 522" preserveAspectRatio="xMinYMin slice">
<path d="M40 281 V428 H0 V94 H40 V241 H400000 v40z M40 281 V428 H0 V94 H40 V241 H400000 v40z"></path>
</svg>
</span>
<span class="halfarrow-right" style="height: 0.522em;">
<svg width="400em" height="0.522em" class="underline" viewBox="0 0 400000 522" preserveAspectRatio="xMaxYMin slice">
<path d="M399960 241 V94 h40 V428 h-40 V281 H0 v-40z M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"></path>
</svg>
</span>
</span>
</span>
</span>
</span>
</span>
function overline(item) {
input = item.parentNode.parentNode.parentNode.parentNode;
item.outerHTML = "";
}