Subtracting Time with JavaScript?

I’m learning basic JavaScript. My issue today feels like a simple one, but I’m having a hard time getting a working result.

I’m trying to create a function that subtracts two times (00:00) that the user inputs themselves.

The idea is:
The user inputs their ‘end time’.
The user then inputs how much time they need to subtract.
Lastly, the function runs and returns their ‘start time’, displayed in the HTML.

This is the HTML I’m using

<h1>SUBTRACT TIME</h1>
    
<div class="timeCalculator">
    <input type="time" id="endTime" placeholder="end time">
    <input type="time" id="elapsedTime" placeholder="minus...">
    
    <button onclick="calculateTime()" type="button" id="button">Go!</button>
    
    <div id="result-startTime"></div>
        
        
</div>

And this is the Javascript

function calculateTime() {
    let var1 = document.getElementById("endTime").value;
    let var2 = document.getElementById("elapsedTime").value;
    
    let answer = var1 - var2;
    console.log(answer);
}

I’ve tried various routes to make this work, but I’ve come up shorthanded every time.