我发现以下代码效果很好
我想知道如何做到这一点
单击 http://stackoverflow.com时打开链接https://stackoverflow.com/questions/ask?title=jquery
这可能吗 ?jquery 新手
<!DOCTYPE html>
<html>
<!--
Created using /
Source can be edited via /uwogi4/2/edit
-->
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>Test Page</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]- ->
<style>
article, aside, figure, footer, header, hgroup,
menu, nav, section { display: block; }
body {
font-family: sans-serif;
}
p {
margin: 0px;
}
</style>
</head>
<body>
<div>Foo <span class='pc_more'>http://www.google.com</span></div>
<div>Bar <span class='pc_more'>http://webvikas.net.in</span></div>
<script>
jQuery(function($) {
$('div').click(function() {
window.location = $(this).find('.pc_more').html();
});
});
</script>
<script src="/js/render/edit.js"></script>
<script>var _gaq=[['_setAccount','UA-1656750-13'],['_trackPageview']];(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src='//www.google-analytics.com/ga.js';s.parentNode.insertBefore(g,s)})(document,'script')</script></body>
</html>