ss
This commit is contained in:
1 parent
028e72828f
commit
187f2f581d
2 files changed
+16
-1
No files matched your search
@@ -79,7 +79,7 @@
|
|||||||
<button type="button" class="button is-primary" id="button-1" onclick="exo1b()" >#button-1</button>
|
<button type="button" class="button is-primary" id="button-1" onclick="exo1b()" >#button-1</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<button type="button" class="button is-warning" id="button-2">#button-2</button>
|
<button type="button" class="button is-warning" id="button-2" onclick="exo1c()" >#button-2</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<button type="button" class="button is-primary is-light" id="button-3">#button-3</button>
|
<button type="button" class="button is-primary is-light" id="button-3">#button-3</button>
|
||||||
|
|||||||
@@ -4,3 +4,18 @@ function exo1b(){
|
|||||||
let userInput = document.getElementById("input-1").value;
|
let userInput = document.getElementById("input-1").value;
|
||||||
document.getElementById("result-box-1").innerText = userInput;
|
document.getElementById("result-box-1").innerText = userInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getInputEqualityMessage(input1, input2){
|
||||||
|
if(input1 === input2){
|
||||||
|
return "input-1 = input-2";
|
||||||
|
}
|
||||||
|
return "input-1 != input-2";
|
||||||
|
}
|
||||||
|
|
||||||
|
function exo1c(){
|
||||||
|
let input1 = document.getElementById("input-1").value;
|
||||||
|
let input2 = document.getElementById("input-2").value;
|
||||||
|
|
||||||
|
document.getElementById("result-box-2").innerText = getInputEqualityMessage(input1, input2);
|
||||||
|
|
||||||
|
}
|
||||||
Reference in new issue
Block a user