Find all link in a div element and disable them all

前端 未结 4 2042
夕颜
夕颜 2021-02-15 16:15

Assume that I have some HTML elements like these :

Click me
4条回答
  •  不要未来只要你来
    2021-02-15 16:39

    I would rely less on jQuery as it might be disabled by the user, so if you want a CSS solution, you can do it like

    #content_div {
       pointer-events: none;
       cursor: default;
    }
    

    Demo

    Edit: To be precise, use this declaration #content_div a

提交回复
热议问题