Sử dụng thuộc tính placeholder trong HTML để hiển thị gợi ý mô tả giá trị mong đợi của phần tử.
Ví dụ
Bạn có thể chạy mã sau để triển khai thuộc tính placeholder:
<!DOCTYPE html>
<html>
<body>
<h2>Đăng nhập</h2>
<form action="/new.php">
<input type="text" placeholder="Tên đăng nhập" name="name"><br>
<input type="password" placeholder="Mật khẩu" name="password"> <br><br>
<input type="submit" value="Gửi">
</form>
</body>
</html>