How to Extract Youtube Video Id From Youtube URL in Javascript

You are currently viewing How to Extract Youtube Video Id From Youtube URL in Javascript

Welcome folks today in this blog post we will be talking about that how to extract the video ID from YouTube URL so for this tutorial we will be using two methods which are there in JavaScript which is first method is split method and the second method is Substring method

Practical Video

 

 

1) Split Method:

The first method split method is used to split up the string into two parts the first part will hold the first portion of the string and the second part will hold the second portion of the string The method split the string into arrays

2) Substring Method:

The second method substring method is used to get a sub portion of the string so this method accept two parameters the first parameter is the starting position of the characters where you want to get your string and the second argument is the last portion of the string where you want to get the characters.

 

Source Code

 

Leave a Reply