if (!mileage) {
valid = 0;
plateErrors = "Please tell us the Vehicle Mileage";
}
if (!price) {
valid = 0;
plateErrors = "We can't generate the report with out Price ";
}
if (valid == 1) {
window.open('https://www.carreport.ae/Home/VehicleInformationByPlate?siteID=1004' +
'&plateSource=' + plate_source + '&plateCode=' + plate_code + '&plateNumber=' + plate_number + '&mileage=' + mileage + '&price=' + price, '_blank');
} else {
var i;
alert(plateErrors);
$('#plateNumberError').removeClass('hidden');
//plateErrors.toString();
$.each(plateErrors, function(key, element) {
$("#plateNumberError").html("<p class='alert alert-danger' role='alert'>" + key + "</p>");
});
}
Above is my sample code:
what i need is I am having an array with error texts .I need to display each text in a P tag and insert all these P tags with error msg to a div.
When I use a for loop i am getting only the characters , not the whole string as one