Found 10878 Articles for Web Development

How to use placeholder attribute in HTML?

Anvi Jain
Updated on 14-May-2020 10:54:04

4K+ Views

If you want to set a hint for text area or input field, then use the HTML placeholder attribute. The hint is the expected value, which gets displayed before the user enters a value, for example, name, details, etc.ExampleYou can try to run the following code to learn how to use placeholder attribute in HTML.           Register                                              

How to use pattern attribute in HTML?

Nitya Raut
Updated on 14-May-2020 10:56:22

330 Views

The pattern attribute in HTML is used to set a regular expression in the following input types: text, url, tel, search, date, email, and password. For passwords, with the pattern attribute, you can set the minimum required values. For example, password should have at least 8 characters.ExampleYou can try to run the following code to learn how to use pattern attribute in HTML. Here, we have set the pattern for 8 or more characters in the password. If a user will add less than that, then by clicking Submit button, an error will raise i.e. “Please match the requested format: ... Read More

How to play sound file in a web-page in the background?

Smita Kapse
Updated on 25-Feb-2020 07:37:38

20K+ Views

The HTML element is used to add audio to web page. To play sound file in the background on a web page, use the … element. Also, use the autoplay attribute. This will run music in the background whenever the page loads.Set the width and height in a way the player hides on the web page. The loop attribute is added to specify whether the audio will start over again.You can try to run the following code to play a sound file in a web page in the backgroundExampleLive Demo           HTML background music ... Read More

How to use multiple attribute in HTML?

Vrundesha Joshi
Updated on 14-May-2020 10:50:22

3K+ Views

The multiple attribute in HTML allows user to enter more than one value. It is a Boolean attribute and can be used on as well as element,To allow multiple file uploads in HTML forms, use the multiple attribute. The multiple attribute works with email and file input types.ExampleYou can try to run the following code to learn how to use multiple attribute in HTML:           HTML multiple attribute                                  Upload multiple files, and click Submit.                    

How to use min and max attributes in HTML?

Yaswanth Varma
Updated on 12-Oct-2022 13:37:18

4K+ Views

The min and max properties in HTML are used to specify the element's acceptable range of values. The max attribute sets the element's maximum value, whereas the min attribute sets the element's minimum value. For input restriction, the min and max attributes are used with the number and date input types. Syntax Following is the syntax to use min and max attributes Let’s dive into the following examples to get a clear idea of how to use min and max attributes in HTML. Using min &max Attribute The min and max attribute in HTML is ... Read More

How to use height and width attributes in HTML?

Rishi Rathor
Updated on 14-May-2020 10:18:06

4K+ Views

The height and width attribute in HTML is used to specify the height and width of the element. The values are set in px i.e. pixels.The height and width attribute is used in the following HTML elements:S. NoElementsAttributeAttribute1 elementheightwidth2 elementheightwidth3 elementheightwidth4 elementheightwidth5 elementheightwidth6 elementheightwidth7 elementheightwidthTo add an image in an HTML page, tag is used. With that, we need to use the attributes height and width to set the height and width of the image in pixels.ExampleYou can try to run the following code to learn how to use height and width attributes in HTML.       ... Read More

How to use formtarget attribute in HTML?

Krantik Chavan
Updated on 15-Jun-2020 11:32:18

161 Views

The formtarget attribute in HTML is used to indicate where the response that is received after the form submission is displayed. It overrides the target attribute of the HTML form tag. Use the formtarget attribute only with input type submit an image.Here are the attribute values of the formtarget attribute −S. NoValueDescription1_blankResponse gets displayed in a new window or tab2_selfThe default value. The response gets displayed in the same frame.3_parentResponse gets displayed in the parent frame4_topResponse gets displayed in the full body of the window5framenameResponse gets displayed in a named iframeExampleYou can try to run the following code to learn ... Read More

How to use the formmethod attribute in HTML?

Nancy Den
Updated on 14-May-2020 10:22:35

95 Views

The formmethod attribute is used to define the HTTP technique for sending form information. This method is usedwith input type submit a picture. It overrides the method attribute of HTML forms.ExampleYou can try to run the following code to learn how to use the formmethod attribute in HTML.           HTML formmethod attribute                        Student Name          Student Subject                              

How to add an audio player to an HTML webpage?

Anvi Jain
Updated on 16-Jun-2020 07:34:20

4K+ Views

The HTML element is used to add audio to web page. To add an audio player, add the controls attribute.The following three audio formats are supported in HTML − MP3, Wav, and Ogg.ExampleYou can try to run the following code to add an audio player to an HTML web pageLive Demo           HTML audio Tag               Click on Play button...       (Song: Kalimba which is provided as a Sample Music in Windows)                          

How to use formenctype attribute in HTML?

karthikeya Boyini
Updated on 15-Jun-2020 11:32:52

120 Views

The formenctype attribute is used to show how the form data should be encoded when it is submitting to the server. It introduced in HTML5 and only used with input type submit an image.Here are the formenctype attribute values −S.NoValue & Description1application/x-www-form-urlencodedThis is the default. All the characters are encoded before sent.2multipart/form-dataNone of the characters are encoded.3text/plainIn this, the spaces are converted to + symbols. However, no special characters are encoded.ExampleYou can try to run the following code to learn how to use the formenctype attribute in HTML.           HTML formenctype attribute                        Name                    

Advertisements