$('.send').click(function(){
let val;
let name;
$('.answer').each(function(item){
val = $(this).val()
name = $(this).attr('name')
// console.log(val)
})
$.ajax({
type:"post",
url:"server.php",
data:{action:"test",value:val,name:name},
success:function(r){
r = JSON.parse(r)
console.log(r)
}
})
})