Adds a high and low price data callout
This commit is contained in:
18
src/highTime.js
Normal file
18
src/highTime.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import Datum from "./datum";
|
||||
|
||||
|
||||
function updateHighTime() {
|
||||
const highTime= document.getElementById("high-time");
|
||||
|
||||
const currentTime = document.getElementById("time").selectedOptions[0].innerText;
|
||||
if (currentTime.toLowerCase() !== highTime.innerText) {
|
||||
highTime.innerText = currentTime.toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
function updateHighVal(datum) {
|
||||
const highVal = document.getElementById("high-val");
|
||||
highVal.innerHTML = datum.getPrice().toLocaleString();
|
||||
}
|
||||
|
||||
export {updateHighTime, updateHighVal};
|
||||
Reference in New Issue
Block a user