cookie

ما از کوکی‌ها برای بهبود تجربه مرور شما استفاده می‌کنیم. با کلیک کردن بر روی «پذیرش همه»، شما با استفاده از کوکی‌ها موافقت می‌کنید.

avatar

Narzullayev’s blog

Dasturlashni o'rganishda biz bilan birga bo'ling

نمایش بیشتر
أوزبكستان33 621زبان مشخص نشده استدسته بندی مشخص نشده است
پست‌های تبلیغاتی
909
مشترکین
اطلاعاتی وجود ندارد24 ساعت
اطلاعاتی وجود ندارد7 روز
اطلاعاتی وجود ندارد30 روز

در حال بارگیری داده...

معدل نمو المشتركين

در حال بارگیری داده...

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Todo List</title>
  <style>
    body {
      font-family: Arial, sans-serif;
    }

    #todo-list {
      width: 300px;
      margin: 50px auto;
    }

    ul {
      list-style-type: none;
      padding: 0;
    }

    li {
      background: #f4f4f4;
      margin: 5px 0;
      padding: 10px;
      cursor: pointer;
    }

    li:hover {
      background: #e0e0e0;
    }

    li.dragging {
      opacity: 0.5;
    }
  </style>
</head>
<body>

<div id="todo-list">
  <h2>Todo List</h2>
  <ul id="tasks">
    <!-- Todo items will be added here dynamically -->
  </ul>
  <input type="text" id="new-task" placeholder="Add a new task">
  <button onclick="addTask()">Add Task</button>
</div>

<script>
  let draggingElement = null;

  function addTask() {
    const taskInput = document.getElementById('new-task');
    const taskText = taskInput.value.trim();

    if (taskText !== '') {
      const tasksList = document.getElementById('tasks');
      const newTask = document.createElement('li');
      newTask.textContent = taskText;
      newTask.draggable = true;

      newTask.addEventListener('dragstart', handleDragStart);
      newTask.addEventListener('dragover', handleDragOver);
      newTask.addEventListener('drop', handleDrop);

      tasksList.appendChild(newTask);
      taskInput.value = '';
    }
  }

  function handleDragStart(event) {
    draggingElement = event.target;
    event.dataTransfer.effectAllowed = 'move';
    event.dataTransfer.setData('text/plain', '');
  }

  function handleDragOver(event) {
    event.preventDefault();
  }

  function handleDrop(event) {
    event.preventDefault();

    const dropTarget = event.target;
    const tasksList = document.getElementById('tasks');

    if (dropTarget.tagName === 'LI') {
      const dropIndex = Array.from(tasksList.children).indexOf(dropTarget);
      const dragIndex = Array.from(tasksList.children).indexOf(draggingElement);

      if (dragIndex < dropIndex) {
        tasksList.insertBefore(draggingElement, dropTarget.nextSibling);
      } else {
        tasksList.insertBefore(draggingElement, dropTarget);
      }

      // Reset draggingElement to null after dropping
      draggingElement = null;
    }
  }
</script>

</body>
</html>
Kimga qiziq bo
نمایش همه...
Photo unavailableShow in Telegram
Photo unavailableShow in Telegram
نمایش همه...
Tech News

2023-yilda sotib olish mumkin boʻlgan oʻyin kompyuterlari uchun eng yaxshi protsessorlar Roʻyxatda Intelning eng soʻnggi 14-avlod protsessorlari birinchilikka chiqa olmagan. Batafsil:

https://technews.uz/p/7709164

Repost from N/a
Photo unavailableShow in Telegram
2023-yilda sotib olish mumkin boʻlgan oʻyin kompyuterlari uchun eng yaxshi protsessorlar Roʻyxatda Intelning eng soʻnggi 14-avlod protsessorlari birinchilikka chiqa olmagan. Batafsil: https://technews.uz/p/7709164
نمایش همه...
نمایش همه...
Tech News

Yangi Apple MacBook Pro: M3, M3 Pro va M3 Max protsessorlari, narxi va dizayni Apple 30-dan 31-oktyabriga oʻtar kechasi Scary Fast taqdimotini oʻtkazdi. Batafsil:

https://technews.uz/p/8845273

Typescript'da generic type'lar haqida ancha yaxshi tushuntirilgan ekan. Foydali bo'ladi degan umiddaman! https://www.youtube.com/watch?v=dLPgQRbVquo
نمایش همه...
The most intimidating TypeScript feature

Generics are a huge reason why TypeScript is SO DARN POWERFUL. Letting you create types from other types, pass types to functions, and even INFER those types without you needing to specify them. They're pretty advanced, though - so if you want to learn more advanced TypeScript, time to strap in. Become a TypeScript Wizard with Matt's TypeScript Course:

https://www.totaltypescript.com/

Follow Matt on Twitter

https://twitter.com/mattpocockuk

00:00 Intro 00:36 Generics on the type level 01:45 Passing type arguments to functions 03:06 Passing type arguments to Set 04:21 Inferring the types 05:55 Constraints on type arguments 08:19 Constraints in functions 10:07 Sometimes 'as' is fine 11:23 Multiple type arguments 14:05 Defaults in type arguments 15:00 Integrating with third-party libraries 17:26 Outro

Photo unavailableShow in Telegram
Array methods visualised. ©opyright
نمایش همه...
نمایش همه...
4 yil…

Assalomu alaykum barchaga! Bugun va’da qilganimdek O‘zbekistondagi oliy o’quv yurtlarda o‘qish arziydimi yoki yo‘qmi kabi savollarga shunchaki 4 yil ta’lim olgan, bakalavr diplomiga ega inson sifatida shaxsiy fikrlarimdan kelib chiqib javob berishga harakat qilaman. Shuni unutmang, har qanday soha vakili (men o‘zimdan kelib chiqib aytaman), shuningdek, IT sohasi vakillari ham oliy ta'lim olishi kerak deb hisoblayman. 2019-yil. 2019-yil sentyabr oyida Universitetda o‘qishim boshlangan. Men uchun universitetda…