javascript视频切换代码(html)

来源:百度知道 编辑:UC知道 时间:2024/05/11 19:41:34
我在一表格中左边一列中有多行,在每行中写有一个MV的名字,右边合并为一个大格子,用来放播放器播放MV,希望在用鼠标点击MV的名字时在播放器中播放相应的MV,代码怎么写啊?

<script language='javascript'>
function play(url) {
var player_box = document.getElementById('player_box');
player_box.innerHTML = "<embd href="+url+"></embd>";
}
</script>

MV的链接
<a href='javascript:play("/path/to/the/mv.wmv");'>MV 1</a>

表格中包含播放器的单元格
<table>
<tr>
<td id='player_box'></td>
</tr>
</table>