如何在引导模式中使用 Javascript 嵌入 <video> 标签?

问题描述 投票:0回答:1
javascript html bootstrap-modal
1个回答
0
投票

请试试这个:

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 标签。

谢谢。

© www.soinside.com 2019 - 2024. All rights reserved.