Help with creating search link

I’m trying to modify an existing video web script.

When a web page loads it displays a thumbnail image and the title. I want to wrap the thumbnail image in a link, but have it dynamically capture the title and add it to the link, like:

<a href=" "><thumbnail></a>

Currenty, when a search takes place on the site the url shows …/search?keyword=

On the web page that loads and displays the thumbnail it has this code:

<div class="video-title pt_video_info">
               <input type="hidden" value="{{ID}}" id="video-id">
               <div class="video-big-title">
                  <h1 itemprop="title">{{TITLE}}

does that info help you to help me capture the title and add it to the link?

I look forward to any comments or assistance, thanks

Well, as you seem to be using some sort of templating code, what happens if you just put the link as
<a href="{{TITLE}} "><thumbnail></a>