Tips & Tutorials – Javascript

How Javascript Files Load (Normal vs Async vs Defer)

Welcome to a quick tutorial on how Javascript files are loaded – Normal, async, and defer. Ever since day one of learning Javascript, we were taught to either code Javascript inline or load them from external files. But just how are these Javascript files loaded? This simple question has somehow eluded many beginners, and in short …

How Javascript Files Load (Normal vs Async vs Defer) Read More »

Set & Get HTML Data Attributes In Javascript (Simple Examples)

Welcome to a quick tutorial on how to set and get HTML data attributes in Javascript. Want to insert your own custom property or data into HTML elements? To set HTML data attributes, we simply define data-KEY=”VALUE” in the opening tag. For example, <div data-color=”red”> We can also set HTML data attributes in Javascript using …

Set & Get HTML Data Attributes In Javascript (Simple Examples) Read More »

Get Set Remove HREF In Javascript – Simple Examples

Welcome to a quick tutorial on how to get, set, and remove the href property in Javascript. By now, you should know href very well. That “thing” we use to specify which webpage to link to. But how can we dynamically change or remove it using Javascript? For a quick answer: To get the href …

Get Set Remove HREF In Javascript – Simple Examples Read More »

3 Ways To Do Case Insensitive String Comparison In Javascript

Welcome to a quick tutorial on how to do case insensitive string comparison in Javascript. Are you trying to do some string comparison, only to discover that Javascript is case sensitive by default? There are a few ways to do case-insensitive string comparison in Javascript: The easy way is to change both strings to lowercase …

3 Ways To Do Case Insensitive String Comparison In Javascript Read More »