我有以下jquery代码
video1=$("#P div video"); alert(video1);
video1.addEventListener('ended',videoEnded,false);
并收到以下错误
TypeError:video1未定义
HTML
<div style="position: relative; z-index: 0;" id="P">
<div style="position:absolute;left:0px;top:0px;z-index:0;">
<video autoplay="" preload="auto">
<source type="video/mp4" src="img/f.mp4"></source>
<source type="video/ogg" src="img/f2.ogv"></source>
</video>
</div>
</div>