Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 16th, 2018 90 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. <html>
  2. <head>
  3.     <title>Site</title>
  4.     <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
  5.     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6.     <meta name="HandheldFriendly" content="true">
  7.     <meta charset="UTF-8">
  8.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  9.     <link rel="stylesheet" type="text/css" href="style.css">
  10.     <link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
  11.     <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
  12.     <link rel="stylesheet" href="style.css">
  13. </head>
  14. <body>
  15. <div class="container">
  16.     <div class="text">
  17.     <h1>To-Do</h1><br>
  18.     </div>
  19.     <form>
  20.         <input type="text" id='uzd' placeholder="Ką reikia atlikti?">
  21.         <button type="submit" form="uzd" value="Submit" hidden onsubmit="button()"></button>
  22.     </form>
  23.     <ul id='uzduotys'>
  24.  
  25.     </ul>
  26.     <script src="script.js"></script>
  27. </div>
  28. </body>
  29. </html>
  30.  
  31.  
  32.  
  33.  
  34.  
  35. function button(){
  36.     var node = document.createElement("Li");
  37.     node.setAttribute("class","li-item");
  38.     var text = document.getElementById("uzd").value;
  39.     if(text===""){
  40.         alert("placeholder");
  41.     }
  42.     else{
  43.         var textnode =document.createTextNode(text);
  44.         node.appendChild(textnode);
  45.         document.getElementById("uzduotys").appendChild(node);
  46.     }
  47.  
  48.  
  49.  
  50.  
  51. }
  52.  
  53. var list = document.querySelector('ul');
  54. list.addEventListener('click', function(ev) {
  55.     if (ev.target.tagName === 'LI') {
  56.         ev.target.classList.toggle('checked');
  57.     }
  58. }, false);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top