jqueryexample.com jQuery show/hide elements another page - jqueryexample.com

jQuery show/hide elements another page by jqueryexample

In normal FAQ pages when user click the question we can easily reach related answer div through named anchor.

Suppose we have a product page which has two div containts details, and according to the link clicked from previous page we show hide respective div.

In page one body part :
<a href="named-anchor.html#product1">Product1</a>
<a href="named-anchor.html#product2">Product2</a>

In page two :
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
var locationHas = window.location.hash;
<div id="product1" style="display:none">Product1 details</div>
<div id="product2" style="display:none">Product2 details</div>

Did you like this? Share it:


No comments yet, be the first.

Leave a Comment