Check Browser JavaScript | Detect user browser Example code

How to detect Safari, Chrome, IE, Firefox and Opera browser? Use the userAgent property of the navigator object to get the User Browser in JavaScript. The userAgent will return a string, where it contains information about the browser by including certain keywords that may be tested for their presence. Note: The information from the navigator Read More…


JavaScript detect tablet | HTML Example code

You can use the navigator API to detect whether the device browser is a tablet or not in the HTML webpage. Of course, you have to use JavaScript and Regular expression with it. Must Read: –JavaScript detect mobile device browser Example code JavaScript detect tablet One line function to detect mobile devices with JavaScript.

Read More…


JavaScript detect mobile device browser | HTML Example code

HTML webpage can detect detect mobile device using JavaScript. Use the JavaScript with regular expression test to detect if browser is a mobile device or not. Example of JavaScript detect mobile device browser Here’s a code that uses an insanely long and comprehensive regex which returns a true or false value depending on whether or Read More…


Simple email validation in JavaScript | Example code

The Simplest email validation in JavaScript can done by using Regular Expression.

Simplest email validation Example in JavaScript To get a valid email id we use a regular expression. Here is complete HTML code:-

Output: Q: Is it possible email id validation in JavaScript without regular expression? Answer: Let’s try it without regex, Read More…


JavaScript detect mobile or tablet | HTML Example code

The Simplest way is using vanilla JavaScript navigator API to detect mobile or tablet in HTML webpage. You have to regex (regular expression) in the query. You can also use a 3rd party library such as wurfl.io:- https://web.wurfl.io/#wurfl-js

Example of JavaScript detect mobile or tablet Using a console log to print message, IT will Read More…


Email regex JavaScript Validation | Example code

An email is a string (a subset of ASCII characters) separated into two parts by @ symbol. A “Unique_personal_id” and a domain. It can easily validate by using regex JavaScript. reg ex – Regular + expression First part can contains the following ASCII characters. Uppercase (A-Z) and lowercase (a-z) English letters. Digits (0-9). Characters ! Read More…


JavaScript contact form validation in HTML | Example code

What if the visitor filled the wrong info in the contact form, to prevent wrong entry from visitors on the website, that we use JavaScript to validate contact form fields. A contact form is basically a set of fields (Name, email id, contact number, and question) on the webpage, Where visitors will fill it and Read More…


Validation in JavaScript for Registration form | HTML example code

Registration form is used in many places, like customers for subscriptions, services, or other programs or plans. You can create a Registration form using HTML and Validate user input data of fields by using JavaScript. Must Read: Student registration form in HTML with JavaScript validation Most common example Gmail or other social media online registration. Read More…


Student registration form in HTML with JavaScript validation | Example code

Student form is used to get the details about the student and store in the database for use. Form can have multiple fields but some are mandatory, Like name, roll number, date of birth etc. When use filling the data on the form there is chances of putting wrong data. If data filled wrong then Read More…


Execute JavaScript after page load | onload, document.onload & window.onload

If you are using a <script> inside <head> than use onload attribute inside the <body> tag to Execute JavaScript after page load. It will run the function as soon as the webpage has been loaded. It’s not the only way to call the JavaScript function after the page load complete. You can use document.onload or Read More…