Dark_Delphin,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<input id="vstavka" name="" size="50">
<script>
var video_id = 12345;
var final1="<input onclick='document.getElementById(\"vstavka\").value = \"[media=http://youtu.be/\"+video_id+\"]\";' class='btn btn-danger' type='button' value='Вставить видео' />";
document.write(final1)
</script>
</body>
</html>