Found 8862 Articles for Front End Technology

HTML DOM Input Button name Property

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

85 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

98 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

111 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 innerText Property

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

144 Views

The HTML DOM innerText property returns and allow us to modify inner text content of an HTML element.SyntaxFollowing is the syntax −1. Returning inner textobject.innerText2. Setting inner textobject.innerText=”text”ExampleLet us see an example of innerText property − Live Demo    body{       text-align:center;    }    .box{       background-color:#347924;       width:100px;       padding:10px;       text-align:center;       font-weight:bold;       font-size:1.5rem;       color:white;       margin:1rem auto;    } innerText property Example Write Hi Write Hello    function ... Read More

HTML DOM innerHTML Property

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

263 Views

The HTML DOM innerHTML property returns and allow us to modify inner HTML of an element. The inner HTML is the content.SyntaxFollowing is the syntax −1. Returning innerHTMLobject.innerHTML2. Setting inner HTMLobject.innerHTML=”value”Here, “value” represents the content or nested HTML elements.ExampleLet us see an example of innerHTML property − Live Demo    body{       text-align:center;    }    .outer-box{       background-color:#347924;       width:200px;       height:200px;       padding:10px;       text-align:center;       font-weight:bold;       color:white;       margin:1rem auto;    }    .inner-box{     ... Read More

HTML DOM id Property

Sharon Christine
Updated on 30-Jun-2020 15:36:01

141 Views

The HTML DOM id property returns and allow us to set id of an HTML element.SyntaxFollowing is the syntax −1. Returning idobject.id2. Setting idobject.id=”value”Here, “value” represents the id of an element.ExampleLet us see an example of id property − Live Demo    p{       background-color:#347924;       color:#fff;       padding:8px;    }    .show{       margin:8px;       color:#347924;       font-size:18px;       font-weight:bold;    } id property Example This is a paragraph with some text and this para has an id "Awesome-para" Show ... Read More

HTML DOM paddingLeft Property

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

61 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

316 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

117 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

Advertisements