Front End Technology Articles - Page 514 of 745

HTML DOM Input Button name Property

karthikeya Boyini
Updated on 30-Jul-2019 22:30:26

172 Views

The HTML DOM name property returns and alter the value of name attribute of an input button in HTML.SyntaxFollowing is the syntax −1. Returning nameobject.name2. Modifying nameobject.name=”text”Here, “text” represents the new name of the input button.ExampleLet us see an example of name property − Live Demo HTML DOM name Property    body{       text-align:center;    }    .btn{       display:block;       margin:1rem auto;       background-color:#db133a;       color:#fff;       border:1px solid #db133a;       padding:0.5rem;       border-radius:50px;       width:80%;    }   ... Read More

HTML DOM Input Button value Property

karthikeya Boyini
Updated on 30-Jul-2019 22:30:26

191 Views

The HTML DOM value property returns and modify the content of the value attribute of input button.SyntaxFollowing is the syntax −1. Returning valueobject.value2. Modifying valueobject.value=”text”ExampleLet us see an example of value property Live Demo HTML DOM value Property    body{       text-align:center    }    .btn{       display:block;       margin:1rem auto;       background-color:#db133a;       color:#fff;       border:1px solid #db133a;       padding:0.5rem;       border-radius:50px;       width:80%;    }    .show-value{       font-weight:bold;       font-size:1.4rem;       ... Read More

HTML DOM Input Button type Property

karthikeya Boyini
Updated on 30-Jul-2019 22:30:26

217 Views

The HTML DOM input button type property returns the type of the input button i.e. whether it is of “button”, “submit” or “reset” type.SyntaxFollowing is the syntax −object.typeExampleLet us see an example of input button type property − Live Demo HTML DOM type Property    body{       text-align:center;    }    .btn{       display:block;       margin:1rem auto;       background-color:#db133a;       color:#fff;       border:1px solid #db133a;       padding:0.5rem;       border-radius:50px;       width:40%;    }    .show-type{       font-weight:bold;   ... Read More

HTML DOM paddingLeft Property

Sharon Christine
Updated on 30-Jul-2019 22:30:26

156 Views

The HTML DOM paddingLeft property returns and add left padding to an HTML element.SyntaxFollowing is the syntax −1. Returning left paddingobject.style.paddingLeft2. Adding left paddingobject.style.paddingLeft=”value”ValuesHere, “value” can be the following −ValueDetailslengthIt defines value padding in length unit.initialIt defines padding to its default value.inheritIn this padding gets inherited from its parent element.percentage(%)It defines padding in percentage of the width of parent element.ExampleLet us see an example of paddingLeft property − Live Demo HTML DOM paddingLeft property    .outer-box{       background-color:#db133a;       width:300px;       height:300px;       margin:1rem auto;    }   ... Read More

How to check whether a NaN is a NaN or not in JavaScript?

Manisha Patil
Updated on 04-Aug-2022 11:50:13

444 Views

In this article let us understand how to check whether a NaN is a NaN or not in JavaScript. Literal constant that is not quoted Not-a-Number is represented by NaN, a special value. NaN is commonly used to signal an error condition for a function that should return a valid number since it always compares unequally to any number, including NaN. Differentiating between different undefined values in JavaScript can be tricky. When working with NaN values in Boolean operations, there are a handful of difficulties to be careful of. The numeric type in JavaScript permits you to describe numbers of ... Read More

What is the importance of str.padStart() method in JavaScript?

vineeth.mariserla
Updated on 30-Jun-2020 15:31:18

220 Views

We can attach two strings using the concat() method. But if we need to attach a specific string at the starting of the first string then the easiest way is string.padStart(). This method not only adds the second string at the start of the first string but also looks after the number of characters to be added. It basically takes two parameters one is the length and the other is second string. The method string.padStart() add the second string to the first based on the length provided to it.syntaxstring.padStart(length, "string");It takes the length as the parameter to concise the resulted string to those ... Read More

How to concatenate two strings so that the second string must concatenate at the end of first string in JavaScript?

vineeth.mariserla
Updated on 27-Jul-2022 07:58:42

1K+ Views

concat() methodThe fundamental operation for combining two strings is concatenation. String combining is a necessary part of programming. We need to first clear out the fundamentals before we can discuss "String Concatenation in JavaScript." A new string is produced when an interpreter performs the operation.In order to create a new string, the concat() method joins the calling string and the string arguments. The initial string and the string that was returned are unaffected by changes to either.When concatenating, string values are first transformed from parameters that are not of the type string.SyntaxFollowing is the syntax of concat() methodconcat(str1) concat(str1, str2) ... Read More

How to modify an array value of a JSON object in JavaScript?

Sai Teja Kotha
Updated on 07-Dec-2022 12:59:09

8K+ Views

In this article, we are going to discuss how to modify an array value of a JSON object in JavaScript. We try to update a new value or modify the existing value in an array. Modifying an array is just like modifying an object when that array is inside the object. The normal general principles of modifying will apply here. Syntax Following is the syntax of the for…in statement. for (var in obj) { //code } Example 1 In this example, we are trying to loop through an array using the for…in statement. This statement ... Read More

How to get the Width and Height of the screen in JavaScript?

Sai Teja Kotha
Updated on 07-Dec-2022 12:51:20

10K+ Views

In this article, we are going to discuss how to get the width and height of the screen in JavaScript. Javascript provides an window.screen object that contains information regarding the user's screen. The information includes height and width, and also many other features. To find the height and width of the screen you need to use the following read-only properties Screen.height − This property is used to get the height of the screen in pixels. Screen.width − This property is used to get the width of the screen in pixels. Syntax Following is the syntax of the height ... Read More

What is the importance of '+' operator in type conversion in JavaScript?

Aman Kumar
Updated on 06-Dec-2022 07:48:50

259 Views

Java script is an autonomous type of language most of the time operation directly convert the value of their write type. But there are also cases in which we need to do explicit type conversion.While Java script provides many ways to convert data from one form to another. But there are two most common types of conversion. converting the value to a string. converting a value to a number. Implicit conversion There are various operators and functions in the JavaScript that automatically convert values to the right type like the alert() function in JavaScript accepts any value and ... Read More

Advertisements