Answer the question
In order to leave comments, you need to log in
How to pass html class using ajax?
Good afternoon.
There is a button to which the following script is attached:
$(document).ready(function()
{
$('.user_type_btn').click(function (e) {
alert("button "+$(this).val());
var data = {"user_type" : $(this).val()}
$.ajax({
url: '/get-user-type-roundtable',
data: JSON.stringify(data),
contentType: 'application/json;charset=UTF-8',
type: 'POST',
success: function(response) {
console.log(response);
round_table_html = document.getElementById("round_table");
round_table_html.innerHTML = response
},
error: function(error) {
console.log(error);
alert(error);
}
});
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question