Is 'disabled' a valid attribute for an anchor tag

前端 未结 6 505
傲寒
傲寒 2020-12-03 16:38

If I have the following simple code segment:

click me &
6条回答
  •  借酒劲吻你
    2020-12-03 17:23

    The button is an input type, that's why disable works. Anchors don't work the same. Try giving your a tag an id and disabling using javascript.

    click me =={{value1}}== =={{value2}}==

    After that can disable the element using js and it should behave as input types do.

    function DisableButton() {
        var submitButton = document.getElementById("someid");
        if (submitButton != null) {
            submitButton.setAttribute('disabled', 'disabled');
        }
    }
    

    Make sure you're getting the right client id of your element.

提交回复
热议问题