Articles on Trending Technologies

Technical articles with clear explanations and examples

How to set the padding of an element with JavaScript?

Shubham Vora
Shubham Vora
Updated on 22-Nov-2022 6K+ Views

In this tutorial, we will look at the methods to set the padding of an element with JavaScript. All of us know that there are margins and padding available in JavaScript. Then, what exactly is the padding of an element? Padding can be termed as the space between an element's content and its border, whereas margin adds space around the edge. Use the padding property in JavaScript to set the padding of an element Let us check out the method to set the padding. Using the Style padding Property In this section, let us discuss the padding property. ...

Read More

How to Only Allow Numbers in a Text Box using jQuery?

AmitDiwan
AmitDiwan
Updated on 22-Nov-2022 14K+ Views

We can easily allow only numbers in a textbox using jQuery. Under the keyup() set the code for allowing only number values so that the textbox never accept strings. We will see two examples − Allow Only Numbers in a TextBox using jQuery replace() Allow Only Numbers in a TextBox using jQuery fromCharCode() Allow Only Numbers in a TextBox using jQuery replace() In this example, we will see how to allow only numbers in a TextBox using jQuery replace(). We must set the code under the keyup to allow only numbers while typing, else the textbox will not ...

Read More

What is JavaScript AES Encryption?

Lokesh Badavath
Lokesh Badavath
Updated on 21-Nov-2022 15K+ Views

In this article, we are going to learn what is JavaScript AES Encryption. AES is an algorithm developed for the encryption of data. AES uses the same key to encrypt and decrypt data, called the symmetric encryption algorithm. AES encryption is Advanced Encryption Standard (AES) to encrypt the data in the application. We use the JavaScript library Forge to perform AES encryption. These algorithms are used in different communication apps such as WhatsApp, Signal, etc. The third-party user cannot be able to decrypt the message, and when the message is reached the destination receiver endpoint, it is decrypted using the ...

Read More

Adding an element at the end of the array in Javascript

Lokesh Badavath
Lokesh Badavath
Updated on 21-Nov-2022 576 Views

In this article, we are going to add an at the end of the array in JavaScript. An array is a special variable, which can hold more than one value. An array is a collection of items stored at contiguous memory locations. The idea is to store multiple items together. This makes it easier to calculate the position of each element by simply adding an offset to a base value of the memory location of the first element of the array. The base value is index 0 for the first element in the array and the difference between the two ...

Read More

How to use input type field with the color picker in HTML?

Lokesh Badavath
Lokesh Badavath
Updated on 21-Nov-2022 2K+ Views

In this article, we are going to learn how to use input type field with the color picker in HTML. We use for input fields with color. It will allow us to select a color from color picker. A color picker will be visible when we will click on the default color box. Here, you can set the default color also with the value attribute in the input field - this value needs to be set in hexadecimal because colors are represented as six-digit hexadecimal values following a hashtag. Syntax Following is the syntax to use input type ...

Read More

How to use input type field with steps in HTML?

Lokesh Badavath
Lokesh Badavath
Updated on 21-Nov-2022 941 Views

In this article, we are going to use input type field with steps in HTML. We use step attribute to specifies the interval between numbers in an element. For example, if our step = "2", numbers could be -4, -2, 0, 2, 4, etc. The step sets the stepping interval when clicking up and down spinner button in the input field, moving a slider left and right on a range. If not explicitly included step, the default will be set to 1 for number and 1 unit type for the date/time input types. The default stepping value for number ...

Read More

How to allow multiple file uploads in HTML forms.

Lokesh Badavath
Lokesh Badavath
Updated on 21-Nov-2022 19K+ Views

In this article, we will learn how to allow multiple files uploads in HTML forms. We use the multiple attributes, to allow multiple file uploads in HTML forms. The multiple attributes work with email and file input types. If you want to allow a user to upload the file to your website, you need to use a file upload box, also known as a file, select box. This is created using the element and the type of attribute is set to file. Syntax Following is the syntax for selecting multiple file uploads in the HTML form. Example ...

Read More

Adding an element at a given position of the array in Javascript

Lokesh Badavath
Lokesh Badavath
Updated on 21-Nov-2022 593 Views

In this article, we are going to learn how to add an element at a given position of the array in JavaScript. An array is a special variable, which can hold more than one value. An array is a collection of items stored at contiguous memory locations. The idea is to store multiple items together. This makes it easier to calculate the position of each element by simply adding an offset to a base value of the memory location of the first element of the array. The base value is index 0 for the first element in the array and ...

Read More

Adding an element at the start of the array in Javascript

Lokesh Badavath
Lokesh Badavath
Updated on 21-Nov-2022 424 Views

In this article, we are going to learn how to add an element at the start of the array in JavaScript. An array is a special variable, which can hold more than one value sequentially. It is a collection of items stored at contiguous memory locations. The idea is to store multiple items together. This makes it easier to calculate the position of each element by simply adding an offset to a base value of the memory location of the first element of the array. The base value is index 0 for the first element in the array and the ...

Read More

How to get the body's content of an iframe in JavaScript?

Lokesh Badavath
Lokesh Badavath
Updated on 21-Nov-2022 24K+ Views

We use getIframeContent(frameId), to get the object reference of an iframe in JavaScript. To get the element in an iframe, first we need access the element inside the JavaScript using the document.getElementById() method by passing iframe id as an argument. Using iframetag The tag in HTML specifies an inline frame. This inline frame is used to embed another document within the current HTML document. The element is supported in every browser like (Google Chrome, Microsoft edge/ internet explorer, Firefox, safari, and opera). We are using srcdoc attribute in tag to specify the HTML content of ...

Read More
Showing 30231–30240 of 61,248 articles
Advertisements