Home > Article > Web Front-end > jquery method to make the entire div area clickable_jquery
The example in this article describes how jquery makes the entire div area clickable. Share it with everyone for your reference. The specific analysis is as follows:
The implementation here allows the user to click on the entire div area, and this code will automatically find the link in the div
$(".myBox").click(function(){ window.location=$(this).find("a").attr("href"); return false; });
Reference HTML:
<div class="myBox"> blah blah blah. <a href="http://google.com">link</a> </div>
I hope this article will be helpful to everyone’s jQuery programming.