I thought this would be a great solution! Problem is, I can't seem to find the footer in the DOM by class name. I try:
document.getElementsByClassName("modal-footer").length //returns length 0
But this returns a length of 0; it can't find the footer. Furthermore, in attempts to understand the HTML architecture, I ran the code:
var compElem = document.getElementById("anElementInMyComponent"); compElem.parentElement.nodeName //BODY compElem.parentElement.parentElement.nodeName //HTML
You can see I'm grabbing an element from my component, then checking its parent which turns out to be BODY, and grandparent is HTML. Why is the parent of my element the BODY, but when I look in my Browser Dev Tools that same element has tons of ancestors prior to BODY, including div modal-body and div modal-container?
- Has anyone found a way to actually add another button to the footer?