Some style, fixed JS
This commit is contained in:
@@ -16,4 +16,23 @@ r(() => {
|
||||
const resultat = await response.text();
|
||||
g('response').innerHTML = resultat;
|
||||
});
|
||||
|
||||
const afegirPart = (t) => {
|
||||
const frase = g('frase');
|
||||
let conector = ' de ';
|
||||
|
||||
if (frase.value === '') {
|
||||
conector = 'la ';
|
||||
}
|
||||
|
||||
g('frase').value = g('frase').value + conector + t;
|
||||
}
|
||||
|
||||
g('absencia').addEventListener('click', () => {
|
||||
afegirPart('absencia')
|
||||
});
|
||||
|
||||
g('presencia').addEventListener('click', () => {
|
||||
afegirPart('presencia')
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user