How to wrap up my link with javascript onclick?
I have this link
<div class="new-div" ><a href="<?php the_permalink(); ?>"><?php the_title(); ?>
In this case user has to press on the title to get the link and I want also to wrap up div class with the link. Tried several variants. I think there should be a 开发者_Go百科solution with javascript onclick function, but do not know actually how to wrap it up. Thank you for your help.
<div class="new-div" onclick="location.href='<?php the_permalink(); ?>'"><a href="<?php the_permalink(); ?>"><?php the_title(); ?>
精彩评论