HTML DOM Form Reset Method

AmitDiwan
Updated on 18-Nov-2023 03:35:42

1K+ Views

The HTML DOM Form reset() method is used for resetting all the values of the form elements and displaying the default values that are specified using the value attribute of the form elements. It acts as a reset button to clear form data and it doesn’t take any kind of parameters. Syntax Following is the syntax for form reset() method − formObject.reset() Example Let us look at an example of the Form reset() method −    form{       border:2px solid blue;       margin:2px;       padding:4px;    } ... Read More

HTML Input Required Attribute

George John
Updated on 18-Nov-2023 03:28:20

2K+ Views

The required attribute of the element is used to set a field which is required to be filled before the form is submitted. If the field set with required attribute is not filled, then on clicking the SUBMIT button, the form won’t submit.Following is the syntax −Let us now see an example to implement the required attribute of the element. Here, we have set 3 fields as required −Example Register Id − Password − DOB − Telephone ... Read More

Search Href Attribute Value of a Link in JavaScript

Vikyath Ram
Updated on 18-Nov-2023 03:22:23

2K+ Views

To get the value of the href attribute of a link in JavaScript, use the href property. It gives you the URL of the linked document in JavaScript.ExampleYou can try to run the following code to get the value of the href attribute of a link.           Qries                var myLink = document.getElementById("anchorid").href;          document.write("Link: "+myLink);          

Return Statement in Catch or Finally Blocks in Java

raja
Updated on 17-Nov-2023 16:33:50

15K+ Views

Yes, we can write a return statement of the method in catch and finally block. There is a situation where a method will have a return type and we can return some value at any part of the method based on the conditions. If we return a value in the catch block and we can return a value at the end of the method, the code will execute successfully. If we return a value in the catch block and we can write a statement at the end of the method after return a value, the code will not execute so it became unreachable ... Read More

Create a 2-Column Layout Grid with CSS

AmitDiwan
Updated on 17-Nov-2023 11:30:34

2K+ Views

To create a 2-column layout grid on a web page, we will create and position two divs, one on the left and the next on the right. Create the First div To begin with, we will create a div, beginning with the left div − Some random text on the left Create the Second div Create the 2nd div i.e., the right div − Some random text on the right Position the divs on the Left and Right The two divs are positioned on the left and right using the left and right property − .left { left: 0; ... Read More

Create User Rating Scorecard with CSS

AmitDiwan
Updated on 17-Nov-2023 11:27:51

821 Views

To create a user rating scorecard, first set the exact icon for a star. That would be done using the Font Awesome icons. The individual ratings are displayed as progress bars. Set the Icon for Star Rating The icon for the star rating is set using Font Awesome Icons. We have added the following CDN path for the Font Awesome icons in the beginning to use it on our web page − For rated, use the fa fa-star rated − The above rated class is styled to make the star look appealing − .rated { color: rgb(255, 0, 0); border: 2px ... Read More

Create a To-Do List with CSS and JavaScript

AmitDiwan
Updated on 17-Nov-2023 11:16:14

452 Views

A to-do list allows you to manage your task. It is like a note. When you type what needs to be done, for example, meeting at 4PM, you press Enter. On pressing Enter, the task gets added and a section for another task is visible wherein you can type the next task, example, lunch with a colleague at 7PM, etc. Add an Input Text to Enter a Task To add an input task, use the . A placeholder is also set using the placeholder attribute − Style the Input The input is set with the todoInput class. ... Read More

Create Scroll Back to Top Button with CSS

AmitDiwan
Updated on 17-Nov-2023 11:08:36

681 Views

On a lot of websites, you must have seen a Top button while you scroll to the bottom. That is called the “scroll back to top” button. Create a Button First, create a button that will be clicked to reach the top − Top Style the top Button The display is set to none to make the button hidden. The button is positioned fixed using the fixed value of the position property. The bottom property is used to position the button downwardsn − topBtn { display: none; position: fixed; bottom: 20px; right: 30px; z-index: 1; ... Read More

Create a Fixed Menu with CSS

AmitDiwan
Updated on 17-Nov-2023 10:38:18

768 Views

To create a fixed menu on a web page, use the position property and set the value fixed. Set the width to 100% using the width property. Set the Navigation Menu Use the element to create the navigation menu on a web page. The links are set using the and the href attribute − Home Login Register Contact Us More Info Style the Navigation Menu We have positioned the menu as fixed using the position property with the value ... Read More

Create a Coupon with CSS

AmitDiwan
Updated on 17-Nov-2023 10:32:34

900 Views

We will see how to create a coupon with CSS. For that, we need to set the company name on the top, an image below, After that comes with coupon code and a text representing when the coupon will expire. Set the Parent Container for the Coupon We gave set the parent cdiv here. Within this we will set the divs for the text, image, etc − Style the parent container − .couponContainer { border: 5px dashed #bbb; width: 80%; border-radius: 15px; margin: 0 auto; max-width: 600px; } Set the Container for the ... Read More

Advertisements