So the next event listener that we want to handle is called The Discharge in Time Change.
So let's create a function here as update.
Discharging time info is very long, but that's okay.
And for this let's console.log the discharge in time info and that is the battery dock's discharge in
time
and let's call the function inside the discharge in time change handler and here we go update discharge
and time info and let's call the same function inside our global function here and let's save it and
let's have a look.
We can see that it is infinity.
So next step is that let's inject into the DOM and the elements is this one that is the battery discharge
in time.
And we have selected it here as battery discharge in time.
So let's get to the event listener and that is this one.
So now we can call the elements dot in HTML and we are going to inject the value is equal to that and
let's remove the console log, let's save it.
And now you can see that it is in the DOM or better.
So we can add the scans to it as scans and let's have some space as that.
And now you can see that infinity scans.
So what about the charging time change?
So let's handle that one also.
So down here, let's create the function as update charging time change info is very long, but that's
okay.
So here we are going to console.log the charging time info as battery dot charging time.
So let's call the function here as update charging info.
And lastly, let's call it above here as an update charging info.
And now let's check our console and we have zero.
So let's inject this value into the DOM and this is what we want called battery charging time.
So it's going to be as battery.
Charging time dot is not a TML is equal to the value.
Let's see what you're going to get.
And we have zero.
So lastly, let's add the seconds to it.
Oh, great.
No space.
Let's add some space.
And that is it.
Charging time is 0 seconds.
Great.
And for the last one, if you want to implement, let's say that if the battery level is 100%, you
can say it is fully charged or it is below 50%.
We can say a low battery and we can give yourself a challenge by implementing this logic.
The next video Let's work on the low cost storage.
How we can create a project using the low cost storage.