partie exercice 2
This commit is contained in:
@ -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 !");
|
||||
}
|
Reference in New Issue
Block a user