<button onclick="Function()">Text</button>
<!--on html-->
<button>Click Me!</button>
/*js code*/
let btn = document.querySelector('button').addEventListener('click', () => {
console.log('"Ohh!" Button clicked!')
});
<!DOCTYPE html>
<html>
<body>
<h2>Example of button </h2>
<p>This is the example of a button clickon it</p>
<button type="button" onclick="document.write(80+20)">click on me</button>
</body>
</html>
//*Testing*//
.button:focus {
outline-color: transparent;
outline-style:solid;
box-shadow: 0 0 0 4px #5a01a7;
transition: 0.7s;
}
<script>
function myFunction() {
var x = document.createElement("BUTTON");
var t = document.createTextNode("Click me");
x.appendChild(t);
document.body.appendChild(x);
}