Cloud Stack Ninja

So I have a function which returns a string. I want that string to show up in a div, after a button is pressed in a different div.

<div >
   <button id="something"> something </button>
<div id="results">
   want result to show up here
const something = document.querySelector('#something');
something.addEventListener('click', someFunction);

someFunction(a, b){
// returns a string and takes two parameters, one parameter from the user 

const results = document.querySelector('#results');
// how to add return value of someFunction as text in the #results div?

Read more here:

Content Attribution

This content was originally published by LiqSnk at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: