DEV Community

Abolhasan Momeni
Abolhasan Momeni

Posted on

2 1

How to delete preview video file with javascript or jquery

js code :

$('#showvideo').on('change', function () {
        var $source = $('#video_here');
        $source[0].src = URL.createObjectURL(this.files[0]);
        console.log($source[0].src);
        $source.parent()[0].load();
    });
Enter fullscreen mode Exit fullscreen mode

html code:

<video class="video"controls>
<source src="mov_bbb.mp4" id="video_here">
</video>
<input type="file" name="video" id="showvideo" class="file_multi_video" accept="video">
Enter fullscreen mode Exit fullscreen mode

...............................................................
I try to delete scr but nothing happen,
how can I deselect the video that selcted.

thanks for your helping guy's,

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay