Is 'disabled' a valid attribute for an anchor tag

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

If I have the following simple code segment:

click me &
6条回答
  •  盖世英雄少女心
    2020-12-03 17:27

    Read w3c Link and the-a-element

    disable is not valid with anchor tags

    instead you can do it by event.preventDefault()

    $('a').click(function(event){
       event.preventDefault();
    });
    

提交回复
热议问题