HTML Attributes and DOM Properties
Finding Angles in a Triangle with JavaScript
CODE: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>page</title> <style> body { padding: 0; margin: 0; font-family: Arial; background: #262626; } .container { width: 500px; height: 180px; background-color: #d7d7d7; border-radius: 10px; padding: 20px; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); } input[type="text"] { width: 460px; padding: 4px; margin:8px; } input[type="button"] { cursor: pointer; padding:... Continue Reading →
When the button is pressed, the script is loaded(basic code)
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>page</title> </head> <body> <p id="result"></p> <button type="button" id="externalJS">Call JS</button> <script> var getJS = document.getElementById("externalJS"); getJS.onclick = function () { var scriptCreate = document.createElement("script"); scriptCreate.type = "text/javascript"; document.body.appendChild(scriptCreate); } </script> </body> </html> BEFORE AFTER