1
所以我想弄清楚在使用javascript容器時如何將mailto鏈接添加到表格單元格。在表格單元格中添加一個mailto鏈接(HTML5)
var users = [ {first_name: "Kaitlin", last_name: "Burns", age: 23, email: "[email protected]"}, {first_name: "Joshua", last_name: "Feir", age: 31, email: "[email protected]"}, {first_name: "Stephen", last_name: "Shaw", age: 28, email: "[email protected]"}, {first_name: "Timothy", last_name: "McAlpine", age: 37, email: "[email protected]"}, {first_name: "Sarah", last_name: "Connor", age: 19, email:"[email protected]"}
];
window.onload = function(){
var tableContainer = document.querySelector("#outputTable");
var myRows = "";
for(var i=0; i < users.length; i++){
myRows += "<tr>" +
"<td>" + users[i].first_name + "</td>" +
"<td>" + users[i].last_name + "</td>" +
"<td>" + users[i].age+ "</td>" +
"<td>" + users[i].email + "</td>" +
"</tr>";
}
tableContainer.innerHTML += myRows;
};
所以bascially顯示的代碼後,我都在那裏,我想要做的就是讓「郵件」部分轉成一個mailto鏈接。我該如何解決這個問題?
謝謝!我甚至無法告訴你,我花了多長時間來嘗試解決這個問題,我想我的語法錯了。非常感激 –