Update html based on if stream is live

Nothing is showing in the console, I’ve just tried this code and the body is still not updating.

window.onload = function() {
let xhr = new XMLHttpRequest();
xhr.open('GET', 'https://api.twitch.tv/helix/streams?user_login=dakotaz', true);
xhr.setRequestHeader("Client-ID", "my client id");
xhr.send();
xhr.onload = function() {
    if (xhr.status != 200) {
        console.log('Handle non 200');
    } else {
        var data = JSON.parse(xhr.responseText);
        if (data && data.data[0]) {
            content = <p>Online</p>
        } else {
            content = <p>Offline</p>
        }
    }
}
}