我如何将音频文件从<input type="file">标签加载到音频标签?我试过了 :
<input type="file" id="file"></input>
<script>
var file = document.getElementById("file");
var audio = document.createElement("audio");
audio.src = file.value;
document.write(audio)
</script>
Run Code Online (Sandbox Code Playgroud) 所以我试图将图像 (rocket.svg) 链接到我的 svg 但是当我将它嵌入到我的网站时 svg 显示而不是 Rocket.svg
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" style="position:fixed; top:0; left:0; height:100%; width:100%; user-select: none;">
<rect style="fill:#33425B;" width="100%" height="100%" id="background"/>
<!-- Rocket -->
<image xlink:href="rocket.svg" x="15%" y="45%" width="10vw" height="10vw" id="rocket"/>
</svg>
Run Code Online (Sandbox Code Playgroud)