partie exercice 2

This commit is contained in:
JunkJumper
2020-01-22 17:27:33 +01:00
parent e22b6fff0e
commit e5d959e93d
2 changed files with 12 additions and 1 deletions

View File

@ -2,7 +2,7 @@ console.log("JavaScript is linked");
function init(){
sayHello();
defTitre1();
defTitre2();
}
function defTitre1() {
@ -11,6 +11,15 @@ function defTitre1() {
}
}
function defTitre2() {
var firstH2 = document.getElementsByTagName("h2");
if(firstH2 != null) {
document.title =firstH2[0].innerText;
console.log("<title> set : Ok Everypony !");
}
}
function sayHello() {
console.log("Hello Everypony !");
}