Tips & Tutorials – Javascript

Simple Shortcut Keys With Pure Javascript (Free Source Code)

Welcome to a tutorial on how to add shortcut keys with Javascript. So you are developing your own web app and want to add some shortcut keys… Or maybe you just want to put in a “top-secret shortcut key” to do some Easter eggs on your website. Yes, it is actually pretty easy to listen …

Simple Shortcut Keys With Pure Javascript (Free Source Code) Read More »

How To Print A Page Or Section in Javascript (Simple Examples)

Welcome to a quick tutorial on how to print a page (or part of it) in Javascript. Looking to create a “print this page” button using Javascript? Or maybe to just print a certain section of the page? The easiest way to print the entire page is to use the window.print() function. Printing a section …

How To Print A Page Or Section in Javascript (Simple Examples) Read More »

Show/Hide HTML Elements With Animation (Simple Examples)

Welcome to a tutorial on how to show/hide HTML elements with animations. So you need to toggle the visibility of an element, but with bells-and-whistles? Here is an easy example to show/hide an HTML element with a fade effect: The HTML element – <div id=”fade”>TEXT</div> The CSS classes: #fade { transition: opacity 1s; } .hide …

Show/Hide HTML Elements With Animation (Simple Examples) Read More »

How to Create Tables From JSON Data in Javascript (Simple Examples)

Welcome to a tutorial and examples on how to create tables from JSON data in Javascript. So code ninja, the time has finally come where you meet the worthy opponent called JSON. Just how do we deal with it, and create tables from JSON data? The table creation will be different depending on how the …

How to Create Tables From JSON Data in Javascript (Simple Examples) Read More »

5 Ways to Allow Only One Click in Javascript (Simple Examples)

Welcome to a beginner’s tutorial on how to allow only one click in Javascript. So you have a button or element that says “click here to do something”, but want to prevent the user from clicking it multiple times. There are a number of ways to allow only one-click in Javascript: Disable the button after …

5 Ways to Allow Only One Click in Javascript (Simple Examples) Read More »

4 Ways To Duplicate HTML Elements In Javascript (Simple Examples)

Welcome to a tutorial on how to duplicate HTML elements. So you are working on a project that requires the creation of evil clones, probably to ease tasks like creating table rows and list items? An easy way to duplicate an HTML element in Javascript is to use the cloneNode() function: var original = document.getElementById(“ID”); …

4 Ways To Duplicate HTML Elements In Javascript (Simple Examples) Read More »

How To Make Unselectable Text In HTML (Simple Examples)

Welcome to a quick tutorial on how to make unselectable text in HTML. So you have a not-so-top-secret website that you want to protect? Stop people from highlighting and copying the text? There are 2 common ways to create unselectable text: In CSS, simply add the user-select: none property. In Javascript, document.getElementById(“TARGET”).onselectstart = function () …

How To Make Unselectable Text In HTML (Simple Examples) Read More »

3 Steps To Filter/Search a List in Javascript (Simple Examples)

Welcome to a beginner’s tutorial on how to filter or search a list in Javascript. So you have a long list of products, users, inventory… or just about any item for the matter. How do we improve the interface and add a search filter to that massive list? Yep, that is doing a search using …

3 Steps To Filter/Search a List in Javascript (Simple Examples) Read More »