HTML5

Accordion with HTML5

This post i will show you HTML5 tag you probably don’t know that exists and it behaves like accordion which means that without using JavaScript we can created accordion or similar type of functionality. <details class=”accordion-item p-2″>         <summary>Accordion Item #1</summary>         <div class=”accordion-body”>           It is shown by default, until the collapse plugin adds the appropriate           classes that we use to style each element. These classes control the           overall appearance, as well as the showing and hiding via CSS…

Simple shopping cart with HTML5 Drag and drop and Javascript

Today i will show you simple shopping cart with Pure JavaScript and HTML drag and drop function getId(id){ return document.getElementById(id); } function dragStart(event){ event.dataTransfer.setData(‘text’,event.target.getAttribute(‘id’)); } function dragDrop(event){ event.preventDefault(); var productQuantiy = 1; var dropId = event.target.getAttribute(‘id’) var data = event.dataTransfer.getData(‘text’);…

ToDoList with JQuery and HTML5 Localstorage

Today i will show you ToDoList using jQuery, HTML5 Localstorage. This is the script document.getElementById(‘myForm’).addEventListener(‘submit’,saveToDo); function saveToDo(e){ elementValue = document.getElementById(‘todoId’).value; if(!elementValue){ alert(“You must enter a value in the New Task field”) return false; } var todo = { name:elementValue }…