(PCC)::[How-to-use-JavaScript-variables]::[js]
<!DOCTYPE html> <html> <body> <h2>JavaScript Variables</h2> <p>In this example, x is defined as a variable. Then, x is assigned the value of 6:</p> <p id="demo"></p> <script> var x; x = 6; document.getElementById("demo").innerHTML = x; </script> </body> </html>
In this example, x is defined as a variable. Then, x is assigned the value of 6: