Link tags in template file auto closing. I’m having an issue wrapping a link around some output in a template file.   I have the right template file; and I can put text like ‘start here’ and ‘end here’  and it prints out where I want the ‘a href’ tag to start and end.  

However when I put in the starting ‘a href’ it auto closes.   I can put in a ‘div’ and that doesn’t auto close.   I’ve tried 
&lt;div href="javascript:void(0)" onclick="window.location.assign("'.$link.'")” &gt;  and although that html output looks right it doesn’t work either. 

I’ve also used at ‘function l’ but can’t pass the $content in. 

Any ideas how I can either stop the auto close, get the javascript to work or a function I can use to output the link but will except the content being passed in. 

Here's my code 

print '&lt;a href="'.$link.'" &gt;'; 
     print $field-&gt;content;
     print '&lt;/a&gt;';
The problem here was that there where links in the content being outputted.  Once I changed that the links stopped auto closing.