ココカラハジメヨウ ウェブ、投資、美容、インビザライン

ウェブデザイン

2018.06.15jQuery

リンクのaタグを要素全体に聞かせるjQuery

jQueryを読み込んで下記を追加。

.boxというclass名をつければその要素全体にリンク要素が効きます。

<script type="text/javascript">
$(function(){
	$(".box").click(function(){
    	window.location=$(this).find("a").attr("href");
    	return false;
    });
});
</script>