The lang attribute lets you specify the main language used in a document, but this attribute is kept in HTML only for backwards compatibility with older versions of HTML.
This attribute has been replaced by the xml:lang attribute in newer XHTML documents.
Source Code:
<!DOCTYPE html>
<html lang="km">
<head>
<meta charset="UTF-8">
<title>ឧទាហរណ៍ lang Attribute</title>
</head>
<body>
<h1>សួស្តី ពិភពលោក</h1>
<p>នេះជាគេហទំព័រដែលសរសេរជាភាសាខ្មែរ។</p>
<span lang="km">អត្ថបទនេះជាភាសាខ្មែរ</span>
</body>
</html>Result:
Watch the video:
Ebook: https://softkhpc.blogspot.com/2026/11/html-tutorial-beginners.html


