Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html lang="hu">
- <head>
- <meta charset="utf-8">
- <title>Form elemek</title>
- <script>
- function eletkor(){
- var age=document.getElementById("age").value
- if (age<30)
- {document.getElementById("kor").innerHTML = age+" évesen még túl fiatal vagy!";}
- else
- {document.getElementById("kor").innerHTML = age+" évesen már tapasztalt vagy!";}
- }
- function kiir(){
- document.getElementById("nevem").innerHTML = document.getElementById("nev").value+", ";
- eletkor();
- }
- </script>
- </head>
- <body>
- <span id="nevem"></span>
- <span id="kor"></span>
- <form name="kerdoiv" action="index.html" method="post">
- <table>
- <tbody>
- <tr>
- <td>
-  
- </td>
- <td>
- <label name="nev">Név: </label>
- </td>
- <td>
- <input type="text" name="nev" id="nev"> </label>
- </td>
- <td>
-  
- </td>
- </tr>
- <tr>
- <td>
-  
- </td>
- <td>
- <label name="nev">Életkor: </label>
- </td>
- <td>
- <select name="age" id="age">
- <option value="18">18</option>
- <option value="23">23</option>
- <option value="28">28</option>
- <option value="33">33</option>
- <option value="38">38</option>
- <option value="43">43</option>
- </select>
- </td>
- <td>
-  
- </td>
- </tr>
- <tr>
- <td>
-  
- </td>
- <td>
- <input type="button" name="kuld" value="Küld" onclick="kiir();">
- </td>
- <td>
- <input type="reset" name="torol" value="Töröl">
- </td>
- <td>
-  
- </td>
- </tr>
- </tbody>
- </table>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement