Quantcast
Channel: JavaScript Changing HTML Content - Stack Overflow
Viewing all articles
Browse latest Browse all 2

JavaScript Changing HTML Content

$
0
0

I have a div with a string inside of it. I want to change that string if something specific happens. I am not sure why but I can't get the string to change at all even if there is no conditional. I am very rusty to JavaScript so any advice would be appreciated, I am slowly getting back to the basics.

<div class="cell text-center" id="changeString"> Report has not yet been pulled for this organization.</div>

var bananas = true;      
if (bananas = true){
    document.getElementById('changeString').innerHTML = "You have successfully run the report.";
}

Can anyone see what I am doing wrong? I have also tried putting the JS into a function and calling it in the div with onload="methodName".


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images