Caffeinated
Caffeinated

Reputation: 12484

What is this functionality called, and is it in HTML or Javascript?

I'd like to find out how this is commonly implemented, mainly because I can't seem to find it in the source code - it's the "graying out" of text that happens whenever a menu-option/button is unable to be clicked. I'm trying to find it in firebug but this is what I find for the image:

<input
    type="submit"
    onclick="LoadingMsg();"
    class="btnclass"
    disabled="disabled"
    id="ctl00_ctl00_Content_ContentItems_btnUpdateQuotas1"
    value="Update Quotas"
    name="ctl00$ctl00$Content$ContentItems$btnUpdateQuotas1"
>

This is what it looks like:

enter image description here

Upvotes: 0

Views: 111

Answers (1)

John Conde
John Conde

Reputation: 219814

It's HTML but can be implemented using JavaScript to manipulate the HTML input/select element to have that property.

This is the attribute that does it: disabled="disabled"

A basic example of JavaScript manipulating this attribute would be:

document.getElementById('elementid').disabled = true;  // Disable element
document.getElementById('elementid').disabled = false; // Enableelement

Resources: disabled attribute

Upvotes: 6

Related Questions