Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta charset='UTF-8'>
  4. <script >
  5. elstyl="white";
  6. elstylo="black";
  7.  
  8. function f()
  9. {
  10. elstyl=document.getElementById("s");
  11. body=document.getElementById("bodik");
  12. body.style="background-color:"+elstyl.value+";"+"color:"+elstylo.value+";";
  13.  
  14. }
  15. function p()
  16. {
  17. elstylo=document.getElementById("ko");
  18. body=document.getElementById("bodik");
  19. body.style="color:"+elstylo.value+";"+"background-color:"+elstyl.value+";";
  20. }
  21. function s(){
  22. napischbk=document.getElementById("w")
  23. chb1=document.getElementById("chb1");
  24. if(chb1.checked){zazn="Zaznaczono";}
  25. else {zazn="Nie Zaznaczono";}
  26. napischbk.innerHTML=zazn;
  27.  
  28. }
  29. function r(){
  30. chbkm=document.getElementById("m");
  31. chbkk=document.getElementById("k");
  32. napischbpl=document.getElementById("info")
  33. if(chbkm.checked){pl="Mężczyzna";}
  34. else if(chbkk.checked){pl="Kobieta";}
  35. else {pl="Nie Wybrano";}
  36. napischbpl.innerHTML="Wybrano Płeć: "+pl;
  37.  
  38. }
  39. function n(){
  40. number=document.getElementById("q");
  41. alert(number.value);
  42. }
  43. //Łukasz turbak to jebana szmata i plik ten nie należy do niego
  44. </script>
  45. </head>
  46. <body id="bodik">
  47. formularz nieco inny:
  48. <form name="w" onChange='f()'>
  49. <select name="s" id='s'>
  50. <option value="white">wybór koloru</option>
  51. <option value="aqua">aqua</option>
  52. <option value="red">czerwony</option>
  53. <option value="blue">niebieski</option>
  54. <option value="yellow">żółty</option>
  55. </select>
  56. </form>
  57. wybierz z listy kolor czcionki
  58. <form name="wybierzkolor">
  59. <select name="ko" id="ko" onChange="p()">
  60. <option value="aqua">aqua</option>
  61. <option value="red">red</option>
  62. <option value="blue">blue</option>
  63. </select>
  64. <hr>
  65. <input type="checkbox" id="chb1" value="opt1"/>Opcja nr 1
  66. <input type="button" value="sprCheck" onClick='s()'>
  67. <p id='w'></p>
  68. <hr>
  69.  
  70. <input type="radio" id="m" name="plec" value="mezczyzna" />
  71. <label for="plec">mężczyzna</label>
  72. <input type="radio" id="k" name="plec" value="kobieta" />
  73. <label for="plec">kobieta</label>
  74.  
  75. <input type="button" value="spRadio" onClick='r()'>
  76. <div id='info'></div>
  77. <hr>
  78. <input type="number" id="q" min="1" max="5" onchange='n()'>
  79. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement