Skip to content Skip to sidebar Skip to footer

Print Console.log On Html

I've a javascript code that is currently working on a shared hosting. The script gather data from a website and then show it on my website. Fact is that the data is being showed in

Solution 1:

Let's say you have a <div id="printFollower"></div> somewhere in your html.

Then do this:

functionprintFollowers(followersSum) {
  document.getElementById('printFollower').innerHTML = followersSum;
  console.log(followersSum); // you can do print followersSum wherever you want
}

Using this method, you can control where the list shows up better, apply CSS, etc.

Solution 2:

Change the text content of some element in your document

functionprintFollowers(followersSum) {
  document.getElementById('myId').textContent = followersSum;
  console.log(followersSum); // you can do print followersSum wherever you want
}

var followersSum = 0;
printFollowers("followersSum = " + followersSum);
<divid="myId" />

Post a Comment for "Print Console.log On Html"