Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to display console.log in HTML

How can I display console.log in html?
I tried many things but can’t get it.
I want this out.guild.members.length to display in html.
Someone can help me?

Thanks!

let url = 'MyURL';

fetch(url)
// Send an HTTP request to the API using fetch.
.then(res => res.json())
// Parse the data as JSON.
.then((out) => {
  console.log(out.guild.members.length);
  // Retrieve the member count.
 
})
.catch(err => { throw err });

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

i’m not quite getting your question
but if you want to display out.guild.members.length in some div in HTML you can add a div inside your HTML.

HTML:

<div id="log"></div>

JS:

document.getElementById("log").innerHTML=out.guild.members.length;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading