Good afternoon. I'm doing a function in which with the CTRL C + CTRL V of a table, on my site, the table is imported. It's working, however, div and style html tags show up in some columns ... How can I hide these tags?
The following is the function code:
function($html){
var modalData = this;
var parser = new DOMParser();
var htmlDoc = parser.parseFromString($html, "text/html");
var $table = $(htmlDoc).find("table");
var jRows = $table.find("tr");
//console.log(jRows);
angular.forEach(jRows, function(jRow, $rowIndex){
if($rowIndex === 0){ return; }
var jCells = $(jRow).find("td");
//console.log(jCells);
angular.forEach(jCells, function(jCell, $cellIndex){
var cellValue = $(jCell).html();
console.log(cellValue);
if($cellIndex === 0){ modalData.lastInvitation = null; }
if(!cellValue){ return; }
//console.log(modalData.invitationList);
if($cellIndex === 0 ){
let invitationName = cellValue;
modalData.lastInvitation = modalData.pushInvitation(invitationName);
return;
}
if($cellIndex === 1){
let phoneNumber = cellValue;
modalData.lastInvitation.telefone = phoneNumber;
return;
}
if($cellIndex === 2){
let email = cellValue;
modalData.lastInvitation.email = email;
return;
}
if($cellIndex >= 3 && $cellIndex < 6){
let codGuestType = modalData.getGuestType[$cellIndex];
let guestQtt = parseInt(cellValue);
modalData.pushGuests(modalData.lastInvitation, codGuestType, guestQtt);
return;
}
let nameColumnIndex = 6;
let guestIndex = $cellIndex - nameColumnIndex;
let guestName = cellValue;
modalData.editGuest(modalData.lastInvitation, guestIndex, guestName);
return;
});