Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!Doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Szotingersv2</title>
- </head>
- <body>
- <form onsubmit="return false">
- Imie:<input type=text id=imie required><br>
- Nazwisko:<input type=text id=nazwisko required><br>
- <select id=list name=list>
- <option value=1>1</option>
- <option value=2>2</option>
- </select><br>
- <button onClick=a()>Wyslij</button>
- </form>
- <script>
- function a(){
- var imie=document.getElementById("imie").value;
- var nazwisko=document.getElementById("nazwisko").value;
- var list=document.getElementById("list").value;
- if(imie!==""&&nazwisko!==""&&list==1){
- document.getElementById("wynik").innerHTML=("<img src='1.jpg' id='zdj' onClick='b()'><br>Wysokość:<input type='text' id='w' >Szerokość:<input type='text' id='h'>");
- }
- if(imie!==""&&nazwisko!==""&&list==2){
- document.getElementById("wynik").innerHTML=("<img src='2.jpg'>");
- }
- }
- function b(){
- var h=document.getElementById("h").value;
- var w=document.getElementById("w").value;
- if(w>=50&&h>=50){
- document.getElementById("wynik").innerHTML=("<img src='1.jpg' width='"+w+"px'height='"+h+"px'>");
- }
- else{
- document.getElementById("wynik").innerHTML="Nie jest wieksze nic 50";
- }
- }
- </script>
- <div id=wynik></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement