I'm trying to add attribute type to the buttons so i can use them inside a form , i try a function in js that collect all btns and set attributes but not wroking well even to select a9s-toolbar most of the time be null or undefined or as empty "HTMLCollection []" , do you have any suggestions?
function modifyButtons() {
// Check if the container and toolbar exist
var container = document.getElementsByClassName('.a9s-toolbar');
if (container) {
console.log(".a9s-toolbar")
var buttons = toolbar.querySelectorAll('.a9s-toolbar-btn');
// Add type="button" to each button
buttons.forEach(function(button) {
button.setAttribute('type', 'button');
});
}
}
I'm trying to add attribute type to the buttons so i can use them inside a form , i try a function in js that collect all btns and set attributes but not wroking well even to select a9s-toolbar most of the time be null or undefined or as empty "HTMLCollection []" , do you have any suggestions?