logo

HTML-knapp deaktivert

den ' funksjonshemmet ' er et attributt for tag i HTML, som brukes til å angi at knappen er deaktivert. Det er et boolsk attributt. Den deaktiverte knappen kan ikke brukes til å klikke, og den vises som en grå farge.

Syntaks

 Text you want to show on the button 

Eksempler: Følgende eksempler bruker forskjellige knapper og gjør dem deaktivert.

Eksempel 1: Følgende eksempel deaktiverer send-knappen.

 Example of Submit Disabled /* The following tag selector body use the font-family and background-color properties for body of a page*/ body { font-family: Calibri, Helvetica, sans-serif; background-color: pink; } /* Following container class used padding for generate space around it, and also use a background-color for specify the color lightblue as a background */ .container { padding: 50px; background-color: lightblue; } /* The following tag selector input uses the different properties for the text filed. */ input[type=text] { width: 100%; padding: 15px; margin: 5px 0 22px 0; display: inline-block; border: none; background: #f1f1f1; } input[type=text]:focus { background-color: orange; outline: none; } div { padding: 10px 0; } /* The following tag selector button uses the different properties for the Button. */ button { color: red; padding: 16px 20px; margin: 8px 0; border: none; cursor: pointer; width: 100%; opacity: 0.9; } Firstname: Middlename: Lastname: Gender : <br> Male Female Other Email: In this example, the disabled attribute is used to disable the Reset button. If you fill the form and then click on the &apos;Reset a form&apos; button, then it will not reset the values of the above form. Reset a Form 
Test det nå

Produksjon:

HTML-knapp deaktivert

Nettleserstøtte

Element chrome nettleserChrome dvs. nettleserDVS nettleseren firefoxFirefox opera nettleserOpera safari nettleserSafari
JaJaJaJaJa