28 lines
383 B
HTML
Executable file
28 lines
383 B
HTML
Executable file
<!DOCTYPE html>
|
|
<html>
|
|
<body>
|
|
|
|
<h2>Exercicis JavaScript UF01 2</h2>
|
|
|
|
<p>Jan Maroto</p>
|
|
|
|
<script>
|
|
input = prompt("Introdueïx el nom d'un fitxers");
|
|
|
|
char = input.charAt(input.lenght-1);
|
|
|
|
output = 'no extension';
|
|
|
|
for (i = input.lenght-1; char != '.'; i--){
|
|
char = input.charAt(i);
|
|
output += char;
|
|
}
|
|
|
|
echo(output);
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|