Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
How to check input file is empty or not using JavaScript/jQuery?
In JavaScript, while working with the form elements, we need to validate the input fields and form elements when a user enters the value. In this tutorial, we will work with the file input. We will also learn to validate the file input. Sometimes, we may be required to check if the file is selected in the input field, then only enable the submit button; otherwise, disable the submit button. So, it will not allow users to submit the form or file without selecting it. Validate the file input using JavaScript In JavaScript, we can access the ...
Read MoreHow to place cursor position at end of text in text input field using JavaScript?
In HTML, the input field is used to take input from the users. Sometimes, we require to take string or long text messages in the input. In these scenarios, users may need to go to the end of the input field to add more content or message. So, we should set up something such that users can click the button, can go to the end of the input field. In this tutorial, we will learn to use JavaScript to place the cursor position at the end of the text in the input field. Using the setSelectionRange() method The ...
Read MoreAugmented Reality (AR) Web Development with JavaScript and AR.js
Augmented Reality (AR) is a technology that overlays digital information and virtual objects onto the real world. It has gained significant popularity in recent years, thanks to advancements in mobile devices and web technologies. In this article, we will explore the basics of AR web development using JavaScript and AR.js, a powerful JavaScript library for creating AR experiences on the web. Understanding Augmented Reality Augmented Reality combines the real world with virtual objects, creating an interactive and immersive user experience. AR applications can be used for various purposes, such as gaming, education, marketing, and visualisation. By leveraging computer ...
Read MoreHow to hide the table header using JavaScript?
Tables are a common element in web development, used to organize and present data in a structured format. While table headers provide valuable context and help users understand the content within a table, there are situations where hiding the table header becomes necessary. Whether it's to enhance the visual design, improve user experience, or accommodate specific requirements, knowing how to hide the table header using JavaScript can be a useful skill for web developers. In this article, we will explore different methods to hide the table header using JavaScript. We will cover techniques that leverage CSS, manipulate the Document ...
Read MoreHow do you write a Javascript code on the HTML page?
Integrating JavaScript with HTML is essential for creating dynamic and interactive web pages. While HTML provides structure, JavaScript adds behavior and interactivity that transforms static pages into engaging user experiences. There are two primary methods to include JavaScript in HTML pages: inline scripts (embedded directly in HTML) and external scripts (linked from separate files). JavaScript Basics Before integrating JavaScript into HTML, understanding basic JavaScript concepts is crucial: Variables and Data Types let name = 'Arya'; const age = 25; var isActive = true; console.log(name); console.log(age); console.log(isActive); Arya 25 true ...
Read MoreHow to Set Default HTML Form Focus Without JavaScript?
A HTML form is a section of a document that includes controls like text fields, password fields, checkboxes, radio buttons, a submit button, menus, and so on. It allows the user to enter any data like name, email address, password, phone number, and so on that will be sent to the server for processing. HTML forms are required if we want to collect information from site visitors. The syntax for creating a form is given below. --form elements— Example: Form Without Focus Here is an example showing a simple form ...
Read MoreGet the relative timestamp difference between dates in JavaScript
Have you ever seen notifications on any website showing the time stamp? It shows something like "12 minutes ago", "2 days ago", "10 hours ago", etc. It is related to the timestamp difference between two dates or times. Also, some apps show that this device's last login was 22 hours ago. So, there are many uses to get the timestamp difference between two dates. In this tutorial, we will learn different approaches to get the relative timestamp difference between two dates. Using getTime() Method with Custom Algorithm In JavaScript, we can create a date object using ...
Read MoreHow to play a notification sound on websites?
Nowadays, web development continues to evolve and find new ways to improve the user experience. One way to improve the user's experience is by adding notifications to the website to notify users of any event. Before we start with the tutorial, let's understand why we need notifications with sounds on the website. Why Add Notification Sounds? As we said above, notification is used to enhance the user experience. We can use it to notify users for a task, such as when users completes the form submission, get a message in the chat app, for reminders, etc. ...
Read MoreHow to Highlight the Searched String Result using JavaScript?
Searching for specific content within a large body of text is a common task in web applications. However, simply displaying the search results without any visual indication can make it challenging for users to identify and focus on the relevant information. That's where the need for highlighting the searched string arises. By dynamically highlighting the matching portions of the text, we can improve the user experience and make it easier for users to locate the desired content. In this article, we will explore different methods to highlight the searched string using JavaScript. We'll cover various techniques that range from ...
Read MoreJavaScript Program for Frequencies of Even and Odd Numbers in a Matrix
To get frequencies of even and odd numbers in a matrix, we will be discussing three different approaches. We will discuss each approach with code examples and solution of the algorithm being used. In this article we are having a 2D matrix, our task is to write a JavaScript program for frequencies of even and odd numbers in a matrix. Users must be familiar with conditional statement, nested loops and javascript operators. Example Input: Matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; Even numbers: {2, 4, 6, 8} Odd numbers: {1, 3, ...
Read More