Easy coding aid

obviously a beginner here.

Im trying to have a videobox autoplay, and then fade out after it has ended.

I have the videobox set to autoplay and all that.

$w ( “#videoBox1” ). onEnded ( ( event ) => {
let targetId = event . target . id ; // “myVideoBox”
});
$w ( “#videoBox1” ). hide ( “fade” );

What’s your question?
What’s the problem?

$w.onReady(() => {
$w("#videoBox1").onEnded(() => {
  $w("#videoBox1").hide("fade");
});
})