var data = val; $.ajax({ type: "POST", data: {value: val, id: id} success: function(html) { alert("d"); } });