Found 601 Articles for Front End Scripts

How to set the color of the bottom border in JavaScript DOM?

Sharon Christine
Updated on 23-Jun-2020 09:14:25

672 Views

To set the color of the bottom border in JavaScript, use the borderBottomColor property. It allows you to set the border color for the bottom of a border.ExampleYou can try to run the following code to learn how to set the color of the bottom border −Live Demo                    #box {             border: 2px dashed blue;             width: 120px;             height: 120px;          }                     Set border bottom color                Demo Text          Demo Text                      function display() {             document.getElementById("box").style.borderBottomColor = "yellow";          }          

How to set the widths of the image border with JavaScript?

Shubham Vora
Updated on 25-Oct-2022 10:23:45

331 Views

In this tutorial, we shall learn to set the widths of the image border with JavaScript. To set the widths of the image border, use the borderImageWidth property in JavaScript. When we need an image as a border of our webpage content, we have to see how to set the width of the image border. Let us discuss the option to achieve this in brief. Using the Style borderImageWidth Property With the Style borderImageWidth property, we can set or return the widths of the image border of an element. The border image will range beyond the padding when the border ... Read More

How to change the value of an attribute in javascript?

Shubham Vora
Updated on 08-Aug-2022 08:36:09

20K+ Views

In this tutorial, we will learn to change the value of an attribute in JavaScript. To build web applications, the most programmer uses three languages. HTML, CSS, and JavaScript. The HTML is used to create the base for the web page, CSS for styling, and JavaScript adds the dynamic behaviours to the web page. Users have seen on many websites that it changes the element's style when they just click on the button. We can make it happen using JavaScript. Using JavaScript, let’s look at setting the new attribute for the HTML element or changing the attribute values dynamically. To ... Read More

How to get the value of the usemap attribute in JavaScript?

Sharon Christine
Updated on 23-Jun-2020 08:53:15

196 Views

To get the value of the usemap attribute of a link in JavaScript, use the useMap property. The usemap attribute is used to tell that the document is html (text/html) or css (text/css), etc.Client-side image maps are enabled by the usemap attribute for the tag and defined by special and extension tags. The image that is going to form the map is inserted into the page using the element as normal, except that it carries an extra attribute called usemap.ExampleYou can try to run the following code to get the value of the usemap attribute of a link ... Read More

How to get the value of the id attribute a link in JavaScript?

Shubham Vora
Updated on 14-Sep-2022 09:12:25

8K+ Views

In this tutorial, we will learn how to get the value of the id attribute a link in JavaScript. The id attribute stores a unique value for an HTML element. The id of an element must be unique, and no other elements should not have the same id. The id attribute of a link can be found in different ways, and in this tutorial, we will discuss the most popular ways of doing it− Using document.getElementById() method Using document.getElementsByTagName() method Using document.querySelectorAll() method Using document.getElementById() Method In JavaScript, The document.getElementById() method is useful for getting different attributes value ... Read More

How to get the id of a form containing a dropdown list with JavaScript?

Shubham Vora
Updated on 15-Sep-2022 12:20:37

4K+ Views

In this tutorial, we will learn how to get the id of a form containing a dropdown list using JavaScript. The id property of an HTML element gives a unique id. The id property value must be unique inside the HTML content. The style sheet property points to a specific declaration of style. JavaScript also uses it to access and alter the element with the specified id. The id property is used to provide an element with a unique identifier. On a web page, you cannot have more than one element with the same id. A dropdown menu in a ... Read More

How to find the value of a button with JavaScript?

Abhishek
Updated on 21-Oct-2023 13:33:58

27K+ Views

In this tutorial, we will learn how we can find the value of a button with JavaScript. Sometimes, we need to use the button tag inside the form tag, where we assign a particularly unique value to each associated with the element using the value attribute. Which later helps the developer to uniquely identify the elements while working with them in the back end. JavaScript provides us with the value property to get the value passed inside the value attribute Let us discuss the value property in detail. Button value Property The button value property is used to get ... Read More

How is NaN converted to Number in JavaScript?

Saurabh Jaiswal
Updated on 11-Aug-2022 14:35:24

9K+ Views

In this article, we will learn how to convert NaN to a Number. NaN in Javascript means Not a Number, whose type is Number but actually, it is not a number. To Convert, the NaN to a Number we use Multiple methods some of which are discussed below. Using the OR (||) operator Using the isNaN() method Using the ~~ operator Using Ternary Operator Using the OR (||) Operator The OR operator is represented by the || sign in JavaScript. To convert the NaN into a number we use the OR operator with NaN and any number and ... Read More

How to convert Boolean to String in JavaScript?

Shubham Vora
Updated on 10-Aug-2022 11:46:24

3K+ Views

In this tutorial, we will learn to convert the Boolean to string in JavaScript. The problem is straightforward: sometimes programmers need to use the boolean true and false values as a string. So, there is a requirement to convert the Boolean to string. Here, we have various methods to convert the Boolean to a string variable. Using the toString() Method Using + and $ (template literal) Operator Using the ternary Operator Using the toString() method The toString() method is the JavaScript string library method, which is useful for converting the variables to the string data type. We can ... Read More

How to find the name of the first form in a document with JavaScript?

Abhishek
Updated on 31-Oct-2022 08:01:48

978 Views

In this tutorial, we will learn how to find the name of the first form in an HTML document. Sometimes, we use more than one form tags in the HTML document for different purposes. At that time, we can face difficulties in finding the specific element to add some more properties to it. In such conditions, we can use the forms property of the "document" interface to access all the elements present in the document individually as well as collectively Document.forms As we discussed above, the forms property is used to access all the forms present in the ... Read More

Advertisements