here is my HTML
<td data-label="Handle" class="server-handle-options noselect">
<i class="server-control-item fa-solid fa-play" api-action="START"></i>
<i class="server-control-item fa-solid fa-arrows-rotate" api-action="RESTART"></i>
<i class="server-control-item fa-solid fa-stop" api-action="STOP"></i>
</td>
My issue is that my code:
// First element of the controls
var controlItems = entryHeadline.querySelector('.server-control-item');
controlItems.addEventListener('click', function () {
console.log("heyyy");
});
Isnt firing when clicking on the server control Item, it was working before because i was using Jquery:
$("#server-list").on('click', '.server-control-item', function () { [. . .] });
Was working, probably because thoses both methods work differently
Here is what the Html looks like in the DOM after the page is fully loaded
<td data-label="Handle" class="server-handle-options noselect">
<svg class="svg-inline--fa fa-play server-control-item" api-action="START" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="play" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" data-fa-i2svg=""><path fill="currentColor" d="M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80V432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"></path></svg><!-- <i class="server-control-item fa-solid fa-play" api-action="START"></i> Font Awesome fontawesome.com -->
<svg class="svg-inline--fa fa-arrows-rotate server-control-item" api-action="RESTART" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="arrows-rotate" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" data-fa-i2svg=""><path fill="currentColor" d="M89.1 202.6c7.7-21.8 20.2-42.3 37.8-59.8c62.5-62.5 163.8-62.5 226.3 0L370.3 160H320c-17.7 0-32 14.3-32 32s14.3 32 32 32H447.5c0 0 0 0 0 0h.4c17.7 0 32-14.3 32-32V64c0-17.7-14.3-32-32-32s-32 14.3-32 32v51.2L398.4 97.6c-87.5-87.5-229.3-87.5-316.8 0C57.2 122 39.6 150.7 28.8 181.4c-5.9 16.7 2.9 34.9 19.5 40.8s34.9-2.9 40.8-19.5zM23 289.3c-5 1.5-9.8 4.2-13.7 8.2c-4 4-6.7 8.8-8.1 14c-.3 1.2-.6 2.5-.8 3.8c-.3 1.7-.4 3.4-.4 5.1V448c0 17.7 14.3 32 32 32s32-14.3 32-32V396.9l17.6 17.5 0 0c87.5 87.4 229.3 87.4 316.7 0c24.4-24.4 42.1-53.1 52.9-83.7c5.9-16.7-2.9-34.9-19.5-40.8s-34.9 2.9-40.8 19.5c-7.7 21.8-20.2 42.3-37.8 59.8c-62.5 62.5-163.8 62.5-226.3 0l-.1-.1L109.6 352H160c17.7 0 32-14.3 32-32s-14.3-32-32-32H32.4c-1.6 0-3.2 .1-4.8 .3s-3.1 .5-4.6 1z"></path></svg><!-- <i class="server-control-item fa-solid fa-arrows-rotate" api-action="RESTART"></i> Font Awesome fontawesome.com -->
<svg class="svg-inline--fa fa-stop server-control-item" api-action="STOP" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="stop" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" data-fa-i2svg=""><path fill="currentColor" d="M0 128C0 92.7 28.7 64 64 64H320c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"></path></svg><!-- <i class="server-control-item fa-solid fa-stop" api-action="STOP"></i> Font Awesome fontawesome.com -->
</td>
By logic, it means that FontAwesome make some alteration in the DOM object making my Event Break, what would be the solutions ?