Giả sử div:
Welcome in JavaScript
Nút bấm ẩn div:
Dùng style.display để ẩn/hiện div. Mã:
Ví dụ
Document Welcome in JavaScript
Chạy: lưu file anyName.html(index.html), chuột phải chọn "Open with Live Server" trong VS Code.
Kết quả
Kết quả đầu ra:

Khi click nút, div ẩn:
