Advertisement
tomur

html

Jul 19th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <!--
  3. -->
  4. <html>
  5. <head>
  6. <title>First Web Page</title>
  7. <style>
  8. body { background-color: firebrick;
  9. color: white;}
  10. div { background-color: blue;
  11. border: 5px solid yellow;
  12. margin: 50px;
  13. padding: 10px;}
  14. </style>
  15. <script>
  16. function test(){
  17. var el = document.getElementById("text1");
  18. el.value = "this is not a test";
  19. var el2 = document.getElementById("textBox1");
  20. var output = document.getElementById("output");
  21. var g = [1,2,3,4,"text",5,6,7,8];
  22. //JSON = java script object notation
  23. // [] means array, {} means object
  24. var obj = {Name:"Tom", Age:20};
  25.  
  26. output.innerHTML="Hello <br>" + g.join("<br>") + "<br>" + JSON.stringify(obj);
  27.  
  28. }
  29.  
  30. </script>
  31. </head>
  32. <body>
  33. <h2>This is a web page</h2>
  34. <div> div stands for division.
  35. A div is a block element
  36. </div>
  37. <input type="text" value="Enter Your Name" id="textBox1"/>
  38. <input type="button" value="Testing"
  39. onClick="test()"/>
  40. <textarea cols="20" rows="3" id="text1">
  41. this is a text area more than one line of text
  42. </textarea>
  43. <div id="output"></div>
  44. </body>
  45. </html>
  46. <!-- this is a comment -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement