var x = document.getElementsByClassName('docs_action_icon docs_delete_row'); for (var i=0; i<x.length; i++) { x[i].click(); } alert("end");