Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.13 KB | None | 0 0
  1.  
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="UTF-8" />
  6. <link rel="stylesheet" type="text/css" href="style.css">
  7. </head>
  8. <body>
  9. <script>
  10. function bold()
  11. {
  12. if (document.getElementById("bold").checked){
  13. document.getElementById("area").style.fontWeight="bold";
  14. }
  15. else{
  16. document.getElementById("area").style.fontWeight="normal";
  17. }
  18. }
  19. function italic()
  20. {
  21. if (document.getElementById("italic").checked){
  22. document.getElementById("area").style.fontStyle="italic";
  23. }
  24. else{
  25. document.getElementById("area").style.fontStyle="normal";
  26. }
  27. }
  28. function cent()
  29. {
  30. if (document.getElementById("aleft").checked){
  31. document.getElementById("area").style.textAlign="left";
  32. }
  33. else if(document.getElementById("acent").checked){
  34. document.getElementById("area").style.textAlign="center";
  35. }
  36. else{
  37. document.getElementById("area").style.textAlign="right";
  38. }
  39. }
  40. function fntchg(arg)
  41. {
  42. if (arg=="Courier New"){
  43. document.getElementById("area").style.fontFamily="Monospace, Courier New";
  44. }
  45. else if(arg=="Arial"){
  46. document.getElementById("area").style.fontFamily="Sans-serif, Arial";
  47. }
  48. else{
  49. document.getElementById("area").style.fontFamily="Times New Roman, t";
  50. }
  51. }
  52. </script>
  53. <center>
  54. <div id="kontener">
  55. <div class="kolumna" id="jeden">
  56. <table border="1">
  57. <tr>
  58. <th colspan="2">
  59. <textarea id="area">Tutaj znajduje się testowy tekst</textarea>
  60. </th>
  61. </tr>
  62. <tr>
  63. <th>
  64. B
  65. </th>
  66. <th>
  67. <input type="checkbox" id="bold" onclick="bold()">
  68. </th>
  69. </tr>
  70. <tr>
  71. <th>
  72. I
  73. </th>
  74. <th>
  75. <input type="checkbox" id="italic" onclick="italic()">
  76. </th>
  77. </tr>
  78.  
  79. <tr>
  80. <th>
  81. Do lewej
  82. </th>
  83. <th>
  84. <input type="radio" id="aleft" name="algin" onclick="cent()">
  85. </th>
  86. </tr>
  87.  
  88. <tr>
  89. <th>
  90. Wycentrowane
  91. </th>
  92. <th>
  93. <input type="radio" id="acent" name="algin" onclick="cent()">
  94. </th>
  95. </tr>
  96.  
  97. <tr>
  98. <th>
  99. Do prawej
  100. </th>
  101. <th>
  102. <input type="radio" id="aright" name="algin" onclick="cent()">
  103. </th>
  104. </tr>
  105.  
  106. <tr>
  107. <th>
  108. Czcionka:
  109. </th>
  110. <th>
  111. <select id="sel" onchange="fntchg(this.value)">
  112. <option id="arial">Arial</option>
  113. <option id="courier">Courier New</option>
  114. <option id="times">Times New Roman</option>
  115. </select>
  116. </th>
  117. </tr>
  118. </table>
  119. </div>
  120. </div>
  121. </center>
  122. </body>
  123. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement