I want to add a YouTube search box to my Web site. Can it be done?
Can it be done? Pshaw! Anything can be built or reverse engineered given the time and motivation!
There’s no reason to think that Google’s YouTube site is any different.
The question is: is it going to be an easy reverse engineering job or a tough one, and that can be quickly ascertained by simply having a peek at the YouTube home page:

As you can see, it’s a rudimentary search box with the input field and a submit button. That’s it.
Should be quite easy to reverse engineer it!
To start, we’ll crack open the source code to the page and isolate the HTML for the search itself:

Looks like a lot of code, but if we scrub all the non-essential code and replace the fancy, attractive button with a regular HTML “submit” button, we’re left with the small HTML snippet:
<input name=”search_query” type=”text”>
<input type=”submit”>
</form>
That’s it. Seriously. It’s not pretty, but it’s functional:
Now let’s make it a bit nicer looking by adding a box around it. This can be most easily done with some CSS styling within a “div” container, like this:
<form action=”http://www.youtube.com/results” method=”get”>
<input name=”search_query” type=”text”>
<input type=”submit”>
</form>
</div>
That gives us this:
What do you think? Want something a wee bit more fancy? How about adding a background color to the box, and a different background color to the (larger) text input field and, for good luck, a third color for the button itself:
<form action=”http://www.youtube.com/results” method=”get”>
<b>Search YouTube for: </b>
<input name=”search_query” type=”text” style=”background-color:#ccf;” size=”45″>
<input type=”submit” style=”background-color:#ffc;”>
</form>
</div>
The result:
You can tweak and fiddle from here as you’d like, but that’ll get you the rudiments of a YouTube search box on your site and a direction to travel for a custom fit. Good luck!

but it opens youtube website in another tab ..i want to display it into div block
Great little trick, far neater way to integrate YouTube into sites!