div onclick isn't working


Staff member
I'm trying to get the caption part of my slider to link to the respective article url on my wordpress site. I'm pretty sure I found the section in the plugin code I think needs to be edited, but when I try to do the following:

echo "<div id='" . $sl_caption . "' class='nivo-html-caption'>" . $sl_htmlcaption . onclick="location.href='$url';"</div>";


I get "syntax error, unexpected T_STRING, expecting ',' or ';" showing up in my slider, and the rest of my site not working. I've tried many variations of what I've tried to do here, but I can't seem to find one that works.

Here's the original entire slider code if it's helpful: <a href="http://pastebin.com/4nKxXkSa" rel="nofollow">http://pastebin.com/4nKxXkSa</a>