(PCC)::[How-JavaScript-statements-can-be-grouped-together-in-code-blocks]::[js]
<!DOCTYPE html> <html> <body> <h2>JavaScript Statements</h2> <p>JavaScript code blocks are written between { and }</p> <button type="button" onclick="myFunction()">Click Me!</button> <p id="demo1"></p> <p id="demo2"></p> <script> function myFunction() { document.getElementById("demo1").innerHTML = "Hello Dolly!"; document.getElementById("demo2").innerHTML = "How are you?"; } </script> </body> </html>
JavaScript code blocks are written between { and }