Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to display api data in html

const p = document.getElementById("myPelement")
fetch('http://example.com/movies.json')
    .then((response) => {
        return response.json();
    })
    .then((data) => {
        p.innerText = data
    });
 
PREVIOUS NEXT
Tagged: #display #api #data #html
ADD COMMENT
Topic
Name
8+3 =