Javascript - How to make div tag into page link, Jquery div tag into href
How to make div tag into page link
HTML code<div class='css_classname'> < a href='index.php'> Index </a> </div> <div class='css_classname'> < a href='linux1.php'> Linux 1 </a> </div> <div class='css_classname'> < a href='linux2.php'> Linux 2 </a> </div>
Css code
<style> .css_classname { border: 3px solid #F3D1B6; border-radius: 10px 10px 10px 10px; color: #E8C2AF; font: bold 11px/20px Tahoma,Geneva,sans-serif; padding: 0 7px; } </style>
Inside javascript or jquery
<script> $('.css_classname').click(function() { window.location.href = $(this).find('a').attr('href'); }); </script>
You can fetch href attribute by using css classname in jquery, In above jquery css_classname is used to fetch href or link.
The topic on Javascript - How to make div tag into page link is posted by - Math
Hope you have enjoyed, Javascript - How to make div tag into page linkThanks for your time