Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>zadaca2</title>
- <style>
- label{
- display: inline-block;
- width: 50px;
- padding: 0px 0px 9px 0px;
- }
- #selektor{
- width: 160px;
- }
- button{
- display: inline-block;
- margin-left: 140px;
- }
- </style>
- </head>
- <body>
- <div>
- <label>Items</label><input type="text" id="items"><br>
- <label>Type:</label><select id="selektor"><br>
- <option value="radio">Radio button</option>
- <option value="checkbox">Check-box</option>
- </select><br>
- <button onclick="prikazi();">Прикажи</button>
- </div>
- <div>
- <div id="show" ></div>
- </div>
- </body>
- </html>
- <script>
- function prikazi() {
- document.getElementById('show').innerHTML = "";
- var number = [];
- var items = document.getElementById('items').value;
- number = items.split(",");
- var dodadi = document.getElementById('show');
- var kakov = document.getElementById('selektor').value;
- for(var i=0; i<number.length; i++){
- dodadi.innerHTML = dodadi.innerHTML + "<input type="+kakov+">" + number[i] + " ";
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement