You need to sign in to do that
Don't have an account?
Olivia Porter 1
Simple JavaScript Not Working On A VisualForce Page
Why does this javascript not work on my page? It works perfect in JSFiddle. I can see that the console is returning bananas. But I get no .innerHTML change what so ever. Any insight?
<script>
var bananas = true;
console.log(bananas);
if (bananas == true) {
document.getElementById("changeString").innerHTML = "You have successfully run the report."
}
</script>
<div class="cell" id="changeString">Instant ID Report has not yet been pulled for this organization.</div>
The solution is in DOMContentLoaded. Please see below:
This allows me to change the innerHTML only after an action takes place.
All Answers
Let me know if that works!
The solution is in DOMContentLoaded. Please see below:
This allows me to change the innerHTML only after an action takes place.