I am a newbie for jquery and I dont know how to get the text of an tag created using Jquery.
I want to send that value to the server using Jquery as request to get values from the database.
$(document).ready(function() {
$.ajax({
type: "GET",
url: "newxml.xml",
dataType: "xml",
success: function(xml) {
var name ;
var lname;
var email;
var city;
//document.write("<table>");
var $tbl = $('#basicTable');
$(xml).find('Details').each(function(){
$tbl.append($('<tr>').append(
$('<td>').text($(this).find('name').text()),
$('<td>').text($(this).find('LastName').text()),
$('<td>').text($(this).find('City').text()),
$('<td>').html("<a href='//www.google.com' >"+$(this).find('Email').text()+"</a>")
));
});
$('#tableWrap').append($tbl);
$('#basicTable').dataTable();
}
});
});
use
.html()instead of.text()hope this will help you..