Fork Copy var sct = document.createElement('script') sct.src = 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js' document.querySelector('body').append(sct); sct.onload = function (e) { var url = $('form').attr('action'); var listQuestionTable = $('.question > tbody > tr > td > input') var jump = 4; var data = {}; data.btnupdate = "Hoàn thành"; for (var i = 4; i < listQuestionTable.length;) { var input = listQuestionTable[i]; var key = input.name; var value = input.value; data[key] = value; i += jump; jump = 10 - jump; } console.log(data); $('.non-completed-subject').each((index, el) => { data.lophocphan = el.value; $.ajax({ url, method: 'post', data }) }); }