$(document).ready(function () { setTimeout(() => { console.log("main form"); var tables = document.querySelectorAll('.entity-grid.subgrid') tables.forEach((elem, index) => { let btn = elem.firstChild let button = elem.firstChild.children[0].children[1] button.remove(button.childNodes); button.id = "agregarSolicitante"; elem.append(button) //buscador if (btn.childNodes[0].childNodes[0].className == 'input-group pull-left view-search entitylist-search') { const divSearch = document.createElement("div"); divSearch.classList = 'divSearch' let tableResponsive = elem.childNodes[0] elem.insertBefore(divSearch, tableResponsive) } $('.divSearch').remove(); const para = document.createElement("span"); para.classList = 'flecha-table' elem.parentNode.parentNode.parentNode.childNodes[0].append(para) }) $(".flecha-table").click(function () { $(this).toggleClass('active') if (this.parentNode.nextElementSibling.className == 'control') { let ds = this.parentNode.nextElementSibling $(ds).toggle('slow'); } }); }, 2000); });