I need half and sleeve(dt, dd) display one line, and color, design is each lines.
so I want add html(hr) after second dd, but not working
and I working with woocommerce, so I want to edit it in the admin panel(editing pages menu) where possible.
can I get the solution?
<script>
function myFunction() {
document.getElementsByClassName('variation-item')[1].innerHTML = '<hr/>';
}
</script>
<dl class="variation">
<dt class="variation- variation-title">half:</dt>
<dd class="variation- variation-item variation-01_S"><p>01_S</p></dd>
<dt class="variation- variation-title">sleeve:</dt>
<dd class="variation- variation-item variation-01_S"><p>01_S</p></dd>
<dt class="variation- variation-title">color:</dt>
<dd class="variation- variation-item variation-01_NONE"><p>01_NONE</p></dd>
<dt class="variation- variation-title">design:</dt>
<dd class="variation- variation-item variation-02_DESIGN"><p>02_DESIGN</p></dd>
</dl>
2
Answers
You can try this:
Javascript insertAfter()
You can also check document.createElement() and Node.insertBefore()
Using
insertAdjacentElement()
withafterend
position