JavaScript function/onclick not working

<h4 id="myH4">?????</h4>
<button id="myButton" onclick="myButton">Click Here!</button>
<script>
document.getElementById("#myButton").onclick = function(){
	const h4 = document.getElementById("#myH4");
	h4.innerText = "$59,343";
}

You are not providing the correct id name to document.getElementById,

I’m trying to change style of an element, and it’s not functioning

By my guess, everything inside the curly braces.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.