请试试这个:
document.getElementById("giza_Pyramid").addEventListener("click", function () {
document.querySelector("#modal_body").innerHTML = '<video class ="giza_Pyramid" width = "450" height = "350" controls src= "Media/gizapyramids.mp4"></video>';
})
使用 innerHTML 的原因是因为包含 HTML 标签。
谢谢。