How to make clickable blocks (using jquery)
13.06.2011

An article to help a good coder. Every good layout designer knows that the <a> tag is an inline element, only an inline element can be put inside it, but often in the design layout it is necessary to make the blocks clickable (for example, "block with news annotations").
What is the way out of this situation?
HTML <div class="post"> <a href="#">News title</a> <p>some annotation text, some annotation text.</p> </div> JQUERY $(document).ready(function(){ $('.post').click(function(){ window.location=$(this).find('a').attr('href'); return false; }) });
PS And the fish here means that "You can't even catch a fish from a pond without labor)"
SUBSCRIBE TO NEWSLETTER
Last in our blog
Internet Marketing
04.11.2019
Internet Marketing
03.10.2019