Basic fetch example

HTML

<input type="button" id="basicFetchButton" value="Try it">

JavaScript

document.getElementById("basicFetchButton").addEventListener("click", function(){
        // Loading the jQuery code
        fetch("http://postman-echo.com/get")
            .then(function (response) {
                response.text().then(function (responseText) {
                    console.log(responseText);
                    alert("Done using Fetch!");
                });
            });
    });