<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Tiêu đề</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(function(){
    $(".addData").click(function(){
        $("p").data("tenData", "Học web chuẩn");
        alert("Hello " + $("p").data("tenData"));
    });
    $(".removeData").click(function(){
        $("p").removeData("tenData");
        alert("Hello " + $("p").data("tenData"));
    });
});
</script>
</head>

<body>
<p></p>
<button class="addData">Tạo dữ liệu</button>
<button class="removeData">Xóa dữ liệu</button>
</body>
</html>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.