Is 'disabled' a valid attribute for an anchor tag

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

If I have the following simple code segment:

click me &
6条回答
  •  南方客
    南方客 (楼主)
    2020-12-03 17:26

    If you don't want to use javascript to disable the anchor (as pruposed in other responses) you can just omit the hrefattribute and the anchor wont work and will even change it's styling.

    Note: I know my answer doesn't directly talk about the disable attribute but the info might still be useful for the audiance, as it was for me.

提交回复
热议问题