<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Tiêu đề</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<style>
.test0 { color: red; }
.test1 { color: blue; }
.test2 { color: green; }
.test3 { color: yellow; }
</style>
<script>
$(function(){
    $('p').attr('class', function (i) {
        return 'test' + i;
    });
});
</script>
</head>

<body>
<p>Thành phần p 01</p>
<p>Thành phần p 02</p>
<p>Thành phần p 03</p>
<p>Thành phần p 04</p>
</body>
</html>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.