HTML Articles

Page 3 of 151

How to work with document.images in JavaScript?

Arushi
Arushi
Updated on 11-Mar-2026 546 Views

Use the document.images property in JavaScript to get the number of tags in a document.ExampleYou can try to run the following code to implement document.images property in JavaScript.           JavaScript Example               TutorialsPoint Tutorials                            var num = document.images.length;          document.write("How many images? "+num);          

Read More

How to set the shape of the border of the top-right corner with JavaScript?

Fendadis John
Fendadis John
Updated on 11-Mar-2026 262 Views

To set the shape of the border of the top-right corner in JavaScript, use the borderTopRightRadius property. Set border radius using this property.ExampleYou can try to run the following code to learn how to set the shape of the top-right border with JavaScript.                    #box {             border: thick solid gray;             width: 300px;             height: 200px          }                     Demo Text             Change top right border radius                function display() {             document.getElementById("box").style.borderTopRightRadius = "20px";          }          

Read More

How to set all the background properties in one declaration with JavaScript DOM?

Swarali Sree
Swarali Sree
Updated on 11-Mar-2026 160 Views

To set the background in JavaScript, use the background property. It allows you to set the background color, image, position, etc.ExampleYou can try to run the following code to learn how to set all the background properties in a single declaration with JavaScript.           Click to Set background                function display() {             document.body.style.background = "url('https://www.tutorialspoint.com/html5/images/html5-mini-logo.jpg') repeat right top";          }          

Read More

How to set the starting position of a background image in JavaScript DOM?

Sharon Christine
Sharon Christine
Updated on 11-Mar-2026 555 Views

To set the starting position of a background image in JavaScript, use the backgroundposition property. It allows you to set the position of the image.ExampleYou can try to run the following code to learn how to set all the position of a background image with JavaScript −                    body {             background-repeat: no-repeat;          }                     Click to Set background image                function display() {             document.body.style.backgroundImage = "url('https://www.tutorialspoint.com/html5/images/html5-mini-logo.jpg')";             document.body.style.backgroundPosition="top right";          }          

Read More

How to set all the border bottom properties in one declaration in JavaScript DOM?

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 11-Mar-2026 188 Views

To set the border bottom properties in one declaration in JavaScript, use the borderBottom property. It allows you to set the border-bottom-width, border-bottom-style, and border-bottom-color.ExampleYou can try to run the following code to learn how to set border bottom properties −                    #box {             border: 2px dashed blue;             width: 120px;             height: 120px;          }                     Set border bottom color                Demo Text          Demo Text                      function display() {             document.getElementById("box").style.borderBottom = "thin dashed #000000";          }          

Read More

Align the components with Bootstrap

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 11-Mar-2026 386 Views

To align the components like nav links, forms, buttons, or text to left or right in a navbar using the utility classes .navbar-left or .navbar-right. Both classes will add a CSS float in the specified direction.ExampleYou can try to run the following code to align components           Bootstrap Example                                                       Alignment                                                                                                    Java                                                                                jmeter                      EJB                      Jasper Report                                            Separated link                                            One more separated link                                                                          Left align-Submit Button                         Left align-Text                                                                                Java                                                                                jmeter                      EJB                      Jasper Report                                            Separated link                                            One more separated link                                                                                             Right align-Submit Button                                         Right align-Text                    

Read More

How do we send an email using HTML forms?

Giri Raju
Giri Raju
Updated on 11-Mar-2026 58K+ Views

To send an email using HTML forms, you need to add the email id to the action attribute of the form. In that, add email proceeding with mailto: i.e. mailto:emailid@example.com.ExampleYou can try to run the following code to send an email using HTML forms −           Student Contact Form                Student Name:          Student Subject:                    

Read More

How to automatically redirect a Web Page to another URL?

Arushi
Arushi
Updated on 11-Mar-2026 46K+ Views

Page redirection is a situation where you clicked a URL to reach a page X but internally you were directed to another page Y. It happens due to page redirection.To redirect from an HTML page, use the META Tag. With this, use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value of the content is the number of seconds; you want the page to redirect after.Set the content attribute to 0, if you want the page to load the new URL immediately.ExampleThe following is an example of redirecting current page to another ...

Read More

What is the difference between height and line-height?

Alex Onsman
Alex Onsman
Updated on 11-Mar-2026 3K+ Views

Height is the vertical measurement of the container, for example, height of a div.Line-height is a CSS property to specify the line height i.e. the distance from the top of the first line of text to the top of the second. It is the space between the lines of two paragraphs.ExampleYou can try to run the following code to learn the difference between height and line height:                    .height {             height: 20px;          }          .lheight { ...

Read More

Add oninput attribute to HTML element with JavaScript?

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 641 Views

For this, use the concept of document.getElementById() along with addEventListener(). Following is the JavaScript code −Example Document Enter the value:    document.getElementById('enterValue').addEventListener("input", function () {       console.log('you have entered the value');    }); To run the above program, save the file nameanyName.html(index.html) and right click on the file and select the option open with live server in VS code editor.OutputWhen user enters a value −

Read More
Showing 21–30 of 1,508 articles
« Prev 1 2 3 4 5 151 Next »
Advertisements