non puoi mettere un tag dentro ad una funzione js. devi metterlo nel body