1<!DOCTYPE html>
2<html>
3 <head>
4 <title>Title of the document</title>
5 </head>
6 <body>
7 <p>There is a hidden message for you. Click to see it.</p>
8 <button onclick="myFunction()">Click me!</button>
9 <p id="demo"></p>
10 <script>
11 function myFunction() {
12 document.getElementById("demo").innerHTML = "Hello Dear Visitor!</br> We are happy that you've chosen our website to learn programming languages. We're sure you'll become one of the best programmers in your country. Good luck to you!";
13 }
14 </script>
15 </body>
16</html>
1<button onclick="myFunction()">Click me</button>
2
3<p id="demo"></p>
4
5<script>
6function myFunction() {
7 document.getElementById("demo").innerHTML = "Hello World";
8}
9</script>
1--------------------------------------
2||| My Entire Code Manage Your Self|||
3--------------------------------------
4
5// Part One //
6function CreateButton() {
7
8var linkbtn = document.createElement("a");
9 linkbtn.innerHTML = "Get Account";
10 linkbtn.href = "http://example.com";
11 document.body.appendChild(btn);
12}
13// Part One End //
14
15// Part Two //
16var btn = document.createElement("a");
17btn.innerHTML = "Get Account";
18btn.style.color = "#ffffff";
19btn.style.padding = "15px 20px";
20btn.style.border = "1px solid #ffffff";
21btn.style.backgroundColor = "#307cee";
22btn.style.borderRadius = "30px";
23btn.href = "http://example.com";
24btn.style.textDecoration = "none";
25btn.style.display = "inline - block";
26btn.style.innerHTML = "Underline Removed";
27document.body.appendChild(btn);
28// Part Two Start //
1<script>
2function myFunction() {
3 var x = document.createElement("BUTTON");
4 var t = document.createTextNode("Click me");
5 x.appendChild(t);
6 document.body.appendChild(x);
7}
1<!DOCTYPE html>
2<html>
3<body>
4
5<h2>Example of button </h2>
6<p>This is the example of a button clickon it</p>
7
8<button type="button" onclick="document.write(80+20)">click on me</button>
9
10</body>
11</html>
12