You Are Viewing Posts Under Category: JavaScript Codes

How-To-Generate-A-Random-Color-Or-An-Array-Using-Pure-JavaScript

How To Generate A Random Color Or An Array Using Pure JavaScript?

Did you ever feel bored or tired of writing long random colors for different divs or spans just to test something simple? When learning about the power of JavaScript and its dynamic influence over an HTML page, one of the first things to jump out as a nascent web developer is the ability to add [&he...
How-To-Enable-Disable-Form-Elements-To-Edit-View-On-Click-Using-JavaScript

How To Enable/Disable Form Elements To Edit/View On Click Using JavaScript?

Sometimes we need to enable and disable input elements like text box, radio buttons, or checkboxes, to make it readable only or sometimes allow users to fill the form with their data but every time you make a change you need to reload the HTML? The question is, how can we do it dynamically without [...
How-To-Remove-Or-Strip-All-HTML-Tags-In-Content-Using-Pure-JavaScript

How To Remove Or Strip All HTML Tags In Content Using Pure JavaScript?

Normally on the server-side, you could use a series of PHP functions (such as strip_tags) and remove HTML and ugly formatting. However, if you’re unable to use the server (or you use Node.js) to achieve this task, then you can still use Javascript to do it. In this article, you will find 3 way...
How-To-Set-Or-Specify-Referring-Page-Using-Pure-JavaScript

How To Set Or Specify Referring Page Using Pure JavaScript?

Like you are making a web app or writing any program where you need to know that from which page your visitor or use came to the current page then it is possible via pure plain vanilla javascript. The reason will be many behind implementing this logic like to display the personalized experience to t...
Run-Execute-A-script-Tag-Inserted-On-Page-Using-innerHTML-DOM

Run/Execute A </script> Tag Inserted On Page Using innerHTML DOM

As you know that innerHTML does not run scripts and here our problems start. So what’s the workaround to this problem. You can view the below-linked answer also that I think is related to my question but tried and not working with my problem. In short, our question is that do you want to run [...
Menu-Bar-Stick-To-Top-After-Scrolling-A-Web-Page-Using-Pure-Vanilla-JavaScript

Menu Bar Stick To Top After Scrolling A Web Page Using Pure Vanilla JavaScript

Have you ever seen one of those fixed (or “sticky’) header bars that disappear when you begin scrolling down the page, then reappear whenever you start to scroll back up? In this exercise, we’ll learn how to build our own using a bit of JavaScript. Sticky navigation (navbar, header navigation)...
Basic-Pure-Vanilla-JavaScript-Fade-In-Out-Slideshow-Without-jQuery

Basic Pure Vanilla JavaScript Fade In/Out Slideshow Without jQuery

There are many Fade In/Out Sliders are available over the internet but here we have a basic simplest pure vanilla javascript-based Fade In/Out Slider that will work best in all major browsers as well as in all handheld devices. You do not have to add any external jQuery library or anything else to i...