Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="pl">
- <head>
- <title>zadanie</title>
- <meta charset="utf-8" />
- </head>
- <body>
- <script>
- function slij()
- {
- var wynik=" ",wynik1;
- var a=document.getElementById("imie").value;
- var b=document.getElementById("nazwisko").value;
- for(i=0;i<document.a.plec.length;i++){
- if(document.a.plec[i].checked==true){
- if(i==0)
- {
- wynik1=" Kobieta";
- }
- if(i==1)
- {
- wynik1="Mężczyzna";
- }
- }
- }
- if (document.getElementById('matematyka').checked) {
- wynik+=" Matematyka";
- }
- if (document.getElementById('fizyka').checked) {
- wynik+=" Fizyka";
- }
- if (document.getElementById('informatyka').checked) {
- wynik+=" Informatyka";
- }
- if (document.getElementById('geografia').checked) {
- wynik+=" Geografia";
- }
- if (document.getElementById('historia').checked) {
- wynik+=" Historia";
- }
- var i=document.getElementById("hobby").value;
- document.getElementById('w').innerHTML=" Imie "+a+" Nazwisko "+b+" Płec "+wynik1+" Przedmiot "+wynik+" hobby "+i;
- }
- </script>
- <form name="a" action="index.html">
- Imię: <input type="text" id="imie" placeholder="Podaj imię" /><br /><br />
- Nazwisko: <input type="text" id="nazwisko" placeholder="Podaj nazwisko" /><br /><br /><br />
- Kobieta: <input type="radio" id="plec" value=" Kobieta"/>
- Mężczyzna: <input type="radio" id="plec" value=" Mężczyzna"/><br />
- <br />
- <br />
- Matematyka: <input type="checkbox" id="matematyka" /><br />
- Fizyka: <input type="checkbox" id="fizyka" /><br />
- Informatyka: <input type="checkbox" id="informatyka" /><br />
- Geografia: <input type="checkbox" id="geografia" /><br />
- Historia: <input type="checkbox" id="historia" /><br />
- <br />
- Zainteresowania:
- <br />
- <textarea id="hobby" cols="50" rows="5"></textarea>
- <button type="button" onclick="slij();">Wyślij JS</button>
- <input type="reset" value="Wyczyść"></input>
- </form>
- <p id="w"></p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement