Advertisement
ProjcheskiF1

[IP] Lab2-Zadaca 1

Oct 28th, 2016
751
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Да се направи се напише функцијата removeColor() која во конзола ќе ја испечати тековно селектираната од листата и ќе се избрише од истата.
  2.  
  3.  
  4. <!DOCTYPE html>
  5. <html><head>
  6.     <meta charset=utf-8 />
  7.     <title>Title</title>
  8. </head>
  9. <body>
  10.  
  11.     <script>
  12.     function removecolor() {
  13.         var x = document.getElementById("colorSelect");
  14.         x.remove(x.selectedIndex);
  15.         x.console.log(x.selectedIndex);
  16.     }
  17. </script>
  18.  
  19.  
  20.  
  21. <form>
  22.     <select id="colorSelect">
  23.         <option>Red</option>
  24.         <option>Green</option>
  25.         <option>White</option>
  26.         <option>Black</option>
  27.     </select>
  28.  
  29.     <input type="button" onclick="removecolor()" value="Select and Remove"><br></form>
  30. </body>
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement