I'm pretty new to coding (januari,2021) and with a lot of online searching I'm able to get pretty far but at this point I'm pretty stuck.
setTimeout(function(){
var supbtn = document.createElement("BUTTON");
supbtn.innerHTML = "Support";
supbtn.className = "Support-logout-class";
supbtn.onclick = function(){window.open("LinkToSite","_blank")};
document.body.appendChild(supbtn);
}, 2000);
There is a default wordpress plugin that the company that I work for uses, and as we are in the proces of building a custom site for this use case we want to try and upgrade the current. (With a lot of succes so far)
Basically there is a default code and I want to add the above stated "button" element at a specific place, currently it's adding inside the "body" and that works perfect!
The code where I want to place it:
<div class="wpws-webinar-summary-content sc-iBEsjs sJWcq">
<div class="sc-fZwumE cyVGPD"></div>
<div class="wpws-webinar-summary-logout sc-gmeYpB fOXvtE">
<svg class="wpws-33" focusable="false" viewBox="0 0 24 24" aria-hidden="true" role="presentation" title="Verlaat het webinar"><path fill="none" d="M0 0h24v24H0z"></path>
<path d="M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"></path>
</svg>
</div>
</div>
I want the generated button to appear before: class="wpws-webinar-summary-logout" (why before?, because if I'm right the code "" isn't set, as in it can change between pages. And I know for sure "wpws-webinar-summary-logout" isn't going to change)
But I just can't seem to find the right search term for this, and when I think I'm close I don't quite seem to understand it yet.
Any, tips, tricks, examples, someone can give to me?
Many thanks in advance! Gr. Ian