Sử dụng wordSpacing trong JavaScript để đặt khoảng cách giữa các từ.
Ví dụ
Bạn có thể thử chạy mã sau để tìm hiểu cách triển khai wordSpacing tài sản -
<!DOCTYPE html>
<html>
<body>
<p id = "pid">This is an example paragraph.</p>
<button type = "button" id="btn" onclick = "display()">Set Space</button>
<script>
function display() {
document.getElementById("pid").style.wordSpacing = "25px";
}
</script>
</body>
</html>