Front End Technology Articles - Page 571 of 860

HTML DOM Input FileUpload name Property

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

122 Views

The HTML DOM FileUpload name property returns and modify the value of the name attribute of an fileupload input type in HTML.SyntaxFollowing is the syntax −1. Returning nameobject.name2. Setting nameobject.name=”text”ExampleLet us see an example of FileUpload name property − Live Demo HTML DOM name Property    body{       background-color:#397367;       color:#fff;       padding:20px;    }    .btn{       display:block;       background-color:#22223B;       color:#fff;       border:none;       padding:0.5rem;       border-radius:50px;       width:80%;       margin:10px;    }   ... Read More

HTML DOM Input FileUpload files Property

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

176 Views

The HTML DOM FileUpload files property returns a FileList object which contains all the files that are selected by the file upload button.SyntaxFollowing is the syntax −object.filesExampleLet us see an example of FileUpload files property − Live Demo    body{       text-align:center;       background-color:#52B2CF;       color:#fff;    }    .btn{       background-color:coral;       border:none;       height:2rem;       border-radius:50px;       width:60%;       margin:1rem auto;       display:block;       color:#fff;       outline:none;    }    .show{   ... Read More

In how many ways can we split a string in JavaScript?

vineeth.mariserla
Updated on 30-Jun-2020 15:51:27

426 Views

In javascript, we can split a string in 3 ways. One is an old way in which string.split() method is used and later on, ES6 has provided 2 more ways to split a string. In the first way spread operator is used and in the second way array.from() method is used. Let's discuss them in detail.String.split()syntaxstring.split();ExampleIn the following example, string.split() method is used to split the provided string to each individual character.Live Demo           const str = 'Tutorialspoint'       var d = str.split('')       document.write(d);     OutputT, u, t, o, r, i, ... Read More

How to repeat a string in JavaScript?

Yaswanth Varma
Updated on 18-Jan-2023 11:50:10

732 Views

In this article we are going to learn about how to repeat a string in JavaScript. We can find the three different ways to repeat a string in JavaScript they are listed below. using a while loop using recursion using ES6 repeat() method Let’s dive into the article to learn more about how to repeat a string in JavaScript. While loop method A while loop in JavaScript is a control flow statement that allows code to be executed repeatedly based on a given boolean condition. Syntax Following is the syntax for while loop while (condition) ... Read More

How to swap variables with destructuring in JavaScript?

vineeth.mariserla
Updated on 30-Jun-2020 15:46:43

245 Views

Swapping variables has become very easy with destructuring. In contemporary javascript swapping takes place by using another variable. It may not be hectic but it is lengthy. But in modern javascript there is no need for the third variable. Let's discuss it in detail.Example-1In the following example, swapping has done using another variable called "temp". Therefore the code got lengthier. Live Demo           var a = "Sachin";       var b = "Tendulkar";       document.write("Before swapping-"+ " "+ a + " " +b);       var tmp = a;       a = b; ... Read More

HTML DOM Input FileUpload disabled Property

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

585 Views

The HTML DOM FileUpload disabled property returns and modify the value of disabled attribute of a FileUpload input type in HTML.SyntaxFollowing is the syntax −1. Returning disabledobject.disabled2. Setting disabledobject.disabled = true|false;ExampleLet us see an example of HTML FileUpload disabled property − Live Demo    body{       background-color:#397367;       color:#fff;       padding:10px;    }    p{       font-size:1.2rem;    }    input{       width:200px;       border:none;       margin:10px 0;    }    .btn{       display:block;       margin:10px 0;       ... Read More

HTML DOM Option text Property

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

156 Views

The HTML DOM option text property returns and modify the text of an option in the HTML document.SyntaxFollowing is the syntax −1. Returning textobject.text2. Modifying textobject.text = “text”ExampleLet us see an example of HTML DOM option text property − Live Demo    html{       height:100%;    }    body{       text-align:center;       color:#fff;       background: radial-gradient( circle farthest-corner at 23.1% 64.6%, rgba(129, 125, 254, 1) 0%, rgba(111, 167, 254, 1) 90% ) no-repeat;       height:100%;    }    p{       font-weight:700;       font-size:1.1rem;   ... Read More

HTML DOM Image Object

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

507 Views

The HTML DOM image Object represents the element of an HTML document.Let us create an img object −SyntaxFollowing is the syntax −document.createElement(“IMG”);PropertiesFollowing are the properties of image Object −PropertyExplanationaltIt returns and modify the value of the alt attribute of an image HTML element.completeIt returns whether the browser finished loading an image in HTML web page or not.crossOriginIt returns and modify the CROS setting of an image HTML element.heightIt returns and modify the value of the height attribute of an image HTML element.naturalHeightIt returns the natural height of an image in HTML document.naturalWidthIt returns the natural width of an image ... Read More

HTML DOM iFrame Object

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

232 Views

The HTML DOM iframe Object represents the element of an HTML document.Let us now create iframe object −SyntaxFollowing is the syntax −document.createElement(“IFRAME”);PropertiesFollowing are the properties of iframe Object −PropertyExplanationcontentDocumentIt returns the document object generated by an iframe HTML element.contentWindowIt returns the window object generated by an iframe HTML element.heightIt returns and modify the value of height attribute of an iframe HTML element.nameIt returns and modify the value of the name attribute of an iframe HTML element.sandboxIt returns and alter the value of sandbox attribute of an iframe HTML element.seamlessIt returns and modify whether the iframe should look seamless like ... Read More

HTML DOM HTML Object

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

358 Views

The HTML Object represents the element of an HTML document.Let us see how to access HTML object −SyntaxFollowing is the syntax −document.getElementsByTagName(“HTML”)Let us see an example of HTML object −Example Live Demo    body{       text-align:center;    }    .btn{       background-color:lightblue;       border:none;       height:2rem;       border-radius:50px;       width:60%;    margin:1rem auto;    }    .show{       font-size:1rem;       font-weight:bold;       color:orange;       border:2px solid green;       padding:10px;       display:none;    } ... Read More

Advertisements