I have my element selected like so
let btn = $("a[translate='server.ipmi.kvm.LAUNCH']")[0];
Then when attempting to insert after it i'm doing the following
btn.after('<a class="btn btn-default" onclick="launchNewKvm()">New KVM</a>')
This is inserting the content as a string for some reason and not as a button as I'd like, If I wrap this as a jQuery element then it inserts as [object Object]
any ideas at all would be appreciated
Here you use after method of javascript, not jquery, which if you need to insert an HTML, it should be a DOM Node or it will be treated as text.
If you want to use jquery after method, then don't get the index
let btn = $("a[translate='server.ipmi.kvm.LAUNCH']");
btn.after('<a class="btn btn-default" onclick="launchNewKvm()">New KVM</a>')