JSFiddle - React, Tailwind, and code Playground
by Louis Tsang
HTML
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
<div class="post">
<h2><a href="http://www.scholat.com/zengweiquan">My Page</a></h2>
<div class="content">
Teaser text...
</div>
</div>
<div class="post">
<h2><a href="https://github.com/ScholatLouis">My Other Page</a></h2>
<div class="content">
Teaser text...
</div>
</div>
JavaScript
$(function(){
$("div.post h2 a").click(function (event) {
var event = event || window.event;
var a = $(this),
href = a.attr('href'),
content = a.parent().next();
content.html(href + " #content");
return false;
});
var posts = $("div.post");
posts.click(function () {
alert("posts click!");
});
});