Use Month Input Type in HTML

Geetu Magoo
Updated on 23-Aug-2022 12:17:38

6K+ Views

In HTML, a form comprises of various elements which helps in making a user interface in a web page. Using which we can collect different nature of nature. One of the commonly used control is Month control i.e. This control basically gives the user a calendar like drop down from which he/she can select or pick up the month and year. The Month control will allow you to choose the date in the pattern of YYYY-MM, where YYYY means the year and MM means the month. Let us see a simple example of Month control.Example ... Read More

Open Webcam Using JavaScript

Kalyan Mishra
Updated on 23-Aug-2022 12:02:44

20K+ Views

In this tutorial, we will learn about the procedure to open a webcam using JavaScript. So, this can be done using WebRTC. WebRTC is a short form of Web Real-Time Communication. Using this object, we can access and capture the Webcam and Microphone devices that are available there in the user device. How to Access Webcam? We can access the user device Webcam and microphone using an ECMAScript object navigator.mediaDevices.getUserMedia(constraints). So, the getUserMedia() function by default seek user permission to use your Webcam. This function returns a promise and once you click ok and give the permission then the promise ... Read More

Use Range Input Type in HTML

Geetu Magoo
Updated on 23-Aug-2022 12:01:43

2K+ Views

A form in HTML is used to take input from the user using various ways or methods. There are many controls helpful in creating a user interface. To take single input, we use textbox and which can be created using . This code will show a control like this −In this control, we can type the exact or precise values which can be later validated or saved in the database. But sometimes we need to have control which will take user’s information or maybe his or her choice of interest where exact information cannot be entered. For example, in case ... Read More

Check If Value is Primitive in JavaScript

Kalyan Mishra
Updated on 23-Aug-2022 11:25:01

3K+ Views

In this tutorial, we are going to know the methods to check if the given data type is primitive or not. Datatypes in JavaScript 1. Primitive 2. Non-primitive Primitive data types − String, number, undefined, boolean, null, symbols, bigint. Non-primitive data types − Object A primitive datatype/value is something that is not an object, and it is represented at the bottom level of the language implementation. All primitive values are immutable which means that you cannot change their type instead you may reassign v new value to the variable. To check if the value is primitive or not, we check ... Read More

Create an Element from a String in JavaScript

Kalyan Mishra
Updated on 23-Aug-2022 11:20:05

2K+ Views

In this tutorial, we will get to know about various methods to create an element from strings in JavaScript. Creating elements from a string can be very useful in case we have to generate elements dynamically which makes the website interactive. An example will be like in a to-do list app we add, delete, and edit to-do items. The createElement() Method We create JavaScript items using the createElement() method. To create a particular element, we pass the item name as a string into the createElement() method. The createElement(tagName) function has a parameter as the name of the tag which will ... Read More

Create Notes Taking App Using HTML, Bootstrap, and JavaScript

Kalyan Mishra
Updated on 23-Aug-2022 11:17:36

622 Views

In this tutorial, we will make a notes-taking app using HTML, Bootstrap, and JavaScript. So, the HTML will use here to add different-different elements, bootstrap will be working here to beautify our design like CSS, and JavaScript will be adding basic functionality like adding and deleting our notes. Let’s see our HTML design of the UI. Our UI will contain a simple text area where we will enter our desired note, a button which will use to add our given note to the list of notes and in the list of notes there will be a delete button on each ... Read More

Join Elements of an Array to Create a String in JavaScript

Kalyan Mishra
Updated on 23-Aug-2022 11:10:01

575 Views

In this tutorial, we will see how to create a string by joining the elements of an array in JavaScript. We will see two different approaches to doing this task. The first approach is using a simple addition operator (+) to add the elements of the array and separator. The second approach is to use the join() method. Approach 1: Using the Addition Operator (+) In this approach, we will pass two parameters to the function the array of which elements we have to Join, and the second parameter will be the separator that the user has to give, basically, ... Read More

Limit Characters in a Textarea in an HTML Form

Geetu Magoo
Updated on 23-Aug-2022 10:19:48

15K+ Views

In HTML, we can create form to accept and store information entered by the user with the help of various elements. These elements are also known as form elements for e.g.: textfield (textbox), radio buttons, checkboxes, drop down or combo box, reset and submit buttons. TextArea is one of the elements that can be created within a form. The textarea is used as a multiline control wherein a user can enter data in many rows and columns. The TextArea control is used for purposes like entering remarks, suggestions, address information, body of e-mail, comments etc. where the size of text ... Read More

Compare Only Date Part Without Comparing Time in JavaScript

Shubham Vora
Updated on 23-Aug-2022 09:55:45

7K+ Views

While developing the applications, sometimes it needs to compare the only date. For example, you are developing some apps in which users must adhere to the deadline and pay for the subscription. If the user pays at any time on or before the end date of the subscription, the user will be able to use the subscription continues. Otherwise, you need to stop the subscription. In this tutorial, we will learn to compare only the date part without comparing the time in JavaScript. In the above cases, we need to compare the two dates without focusing on the time. Approach ... Read More

Come Out of a Switch Case in JavaScript

Shubham Vora
Updated on 23-Aug-2022 09:53:14

2K+ Views

In this tutorial, we will learn to come out of a switch case in JavaScript. The switch-case statement is the advanced version of the too many complicated if-else statements. Suppose that in the code, you apply too many conditions to the if-else statement; it will become complicated. Users can see the example of too many if-else here. if( condition 1) { // some code } else if( condition 2 ) { // some code for this block } else if( condition 3 ) { // some code for this block } ... Read More

Advertisements