11import { buildDataTable } from './buildDataTable.js'
22
33const title = document . getElementById ( 'title' ) ;
4- const refresh_button1 = document . getElementById ( 'refresh-button1' ) ;
5- const refresh_button2 = document . getElementById ( 'refresh-button2' ) ;
6- const refresh_button3 = document . getElementById ( 'refresh-button3' ) ;
7- const refresh_button4 = document . getElementById ( 'refresh-button4' ) ;
4+ const refresh_button1_el = document . getElementById ( 'refresh-button1' ) ;
5+ const refresh_button2_el = document . getElementById ( 'refresh-button2' ) ;
6+ const refresh_button3_el = document . getElementById ( 'refresh-button3' ) ;
7+ const refresh_button4_el = document . getElementById ( 'refresh-button4' ) ;
8+ const cleanUp_el = document . getElementById ( 'cleanUp' ) ;
89
910const data1 = [
1011 {
@@ -4765,19 +4766,25 @@ const data4 = []
47654766
47664767const number_of_buttons = 6 ;
47674768
4768- refresh_button1 . addEventListener ( 'click' , function ( ) {
4769+ refresh_button1_el . addEventListener ( 'click' , function ( ) {
47694770 buildDataTable ( data1 , number_of_buttons , custom_head_titles1 ) ;
47704771 title . textContent = 'Lista 1'
47714772} )
4772- refresh_button2 . addEventListener ( 'click' , function ( ) {
4773+ refresh_button2_el . addEventListener ( 'click' , function ( ) {
47734774 buildDataTable ( data2 , number_of_buttons , custom_head_titles2 ) ;
47744775 title . textContent = 'Lista 2'
47754776} )
4776- refresh_button3 . addEventListener ( 'click' , function ( ) {
4777+ refresh_button3_el . addEventListener ( 'click' , function ( ) {
47774778 buildDataTable ( data3 , number_of_buttons , custom_head_titles3 ) ;
47784779 title . textContent = 'Lista 3'
47794780} )
4780- refresh_button4 . addEventListener ( 'click' , function ( ) {
4781+ refresh_button4_el . addEventListener ( 'click' , function ( ) {
47814782 buildDataTable ( data4 , number_of_buttons , ) ;
47824783 title . textContent = 'Lista 4'
4784+ } )
4785+ cleanUp_el . addEventListener ( 'click' , function ( ) {
4786+ const place_for_list_el = document . getElementById ( 'place-for-list' ) ;
4787+ const title_el = document . getElementById ( 'title' ) ;
4788+ place_for_list_el . innerHTML = ''
4789+ title_el . innerHTML = ''
47834790} )
0 commit comments