Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .
- .
- .
- <script type="text/javascript">
- $(document).ready(function(){
- $(".add-row").click(function(){
- var name = $("#name").val();
- var classn = $("#classn").val();
- var maths = $("#maths").val();
- var physic = $("#physic").val();
- var chemist = $("#chemist").val();
- var add = '<tr> <td></td> <td>' + name + '</td> <td>' + classn + '</td> <td>' + maths + '</td> <td>' + physic + '</td> <td>' + chemist + '</td> <td><p class="tb">?</p></td> </tr>';
- $("tbody").append(add);
- });
- $(".countTB").click(function(){
- var x = $("#maths").val();
- var y = $("#physic").val();
- var z = $("#chemist").val();
- var average = (x+y+z)/3; //khi x, y, z = 1 thì average lại cho đáp án 37
- $("p").each(function(){
- if ($(this).html() == "?") {
- $(this).html('');
- $(this).append(average);
- };
- });
- });
- $(".countHSG").click(function(){
- $("tr p").each(function(){
- if ($(this).html() !=="?" && $(this).html() >= 8) {
- $(this).css("color", "red"); //chỉ tô đỏ p thôi, yêu cầu là tô đỏ nguyên hàng
- };
- });
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement