JavaScript, since its inception in 1995, has experienced remarkable evolution, transforming from a simple scripting language to a versatile and widely-used programming language. This journey reached a significant milestone with the introduction of ECMAScript 6 (ES6), also known as ECMAScript 2015, which was officially released in June 2015. ES6 marked a major leap in the […]
JavaScript Basics for Beginners: Navigating the Modern JavaScript Landscape
JavaScript, since its inception in 1995, has evolved from a simple scripting language to a powerful tool indispensable in modern web development. It’s a language that has grown in tandem with the internet, adapting and expanding to meet the ever-changing needs of web designers and users alike. This journey has seen JavaScript become not just […]
How to maximize the browser window using JavaScript
To maximize the browser window to fit the screen, we first move the window to the top left corner and then set its size to the size of the client’s desktop:
How to go back one page in the browser history using JavaScript
Using JavaScript you can go back or forward in the browser’s navigation history. Most of the time you want to go back one page by clicking a link in the page. For doing that, use the following code: <a href=”javascript:history.go(-1)”>Go back</a> It’s easy to figure out that to go back more pages in history, you […]
Validating credit card numbers
This JavaScript function checks a text field for a valid credit card number through several validation methods.
Strip HTML using JavaScript
A simple function that uses regular expressions to strip the HTML tags out of strings.
Add to favorites/bookmarks in Internet Explorer and Firefox
With only a few JavaScript lines you can initiate the dialog for “Add to Favorites” dialog in Internet Explorer and the “Add to Bookmarks” dialog in Firefox, as shown in this example.
Check / uncheck all checkboxes in a form
One easy JavaScript function that will check or uncheck all the checkboxes in a form that’s being passed as the first argument to the function.
Validate phone number using RegEx and JavaScript
A function to validate phone numbers using JavaScript and regular expressions. It will work with all valid US phone numbers in all popular formats.
Swap string case using JavaScript
The SwapCase function turns lowercase characters into uppercase and uppercase characters into lowercase.