How to disable and enable HTML table using Javascript?

前端 未结 10 1270
醉梦人生
醉梦人生 2020-12-11 18:04

I want to know how can I disable and enable the highlighting on an HTML table using Javascript by clicking an html button.

Here are my codes:

tabletest.ht

10条回答
  •  -上瘾入骨i
    2020-12-11 18:24

    
    
    
    
    
    
    
    
     
    Name Address
    Tom UK
    Hans Germany
    Henrik Denmark
    Lionel Italy
    Ricardo Brazil
    Cristiano Portugal

    Fixed your code. Use a function to check if it's disabled, if it isn't, then highlight. If it is, then don't. Simple enough.

    Demo

提交回复
热议问题