/ Published in: jQuery

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<script type="text/javascript"> $(function() { $('#link a').click(function(e) { var url = $(this).attr('href'); $('#elementToLoadContentInto').load(url); e.preventDefault(); }); }); </script> HTML: basic list like <ul> <li><a href="#" id="link">blabla</a></li> </ul> <div id="elementToLoadContentInto"> blablabla </div>
Comments
