开发者

How to wrap up my link with javascript onclick?

开发者 https://www.devze.com 2023-04-01 12:03 出处:网络
I have this link <div class=\"new-div\" ><a href=\"<?php the_permalink(); ?>\"><?php the_title(); ?>

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(); ?>  
0

精彩评论

暂无评论...
验证码 换一张
取 消