How to obtain lang attribute in HTML using JavaScript?

后端 未结 2 1788
甜味超标
甜味超标 2020-12-08 18:29

How to obtain lang attribute in HTML using JavaScript?


         


        
2条回答
  •  误落风尘
    2020-12-08 18:46

    If both attributes agree on their values (as they should), it's enough to read either of them. I'd suggest using

    document.documentElement.lang
    

提交回复
热议问题