troubleshooting Question

Hide/Reveal Divs based on UL List - cookied state

Avatar of BearWebContent
BearWebContentFlag for Bosnia and Herzegovina asked on
JavaScriptHTML
4 Comments1 Solution407 ViewsLast Modified:
I have an existing drop down that displays hidden divs, but I need to cookie the selection so that when you go to another page with a drop-down, it defaults to that selected state.

https://www.bankofthewest.com/personal-banking/savings-accounts/savings-and-moneymarket/online.html 

I also have code that I used before that displays a drop down based on a UL list that, when selecting the state, takes you to another page. This code sets a cookie so that when you go to another page, the default is the state you selected.

Is there a way that I can combine the two? I would like the look of the second version and cookie of the second version but instead of going to another page, I want it to reveal a hidden div.  See code below.

<h1 class="header">Checking</h1>
<div id="option-selector" style="padding-bottom: 0px">
<h2>With a variety of features and benefits, you can find the checking account that offers the best value and the right fit for you</h2>
</div>
<h2 class="header compare wrapper" style="height: 20px;">
<div class="left">Compare Checking Accounts:</div>

<form>
			<div id="compare-select" class="select hide-dropdown">
				<div class="wrapper">
					<a onClick="return observeOpener(this);" href="" class="dd-opener">Select a state</a>
					<a onClick="return observeOpener(this);" href="" class="dd-opener pulldown-arrow"></a>
				</div>
<ul class="selectbox"><li><a href="vgn_ext_templ_rewrite?vgnextoid=1437577ec605e210VgnVCM1000006ce1680aRCRD&vgnextchannel=1437577ec605e210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">Arizona</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1b35861dca6d1210VgnVCM1000006ce1680aRCRD&vgnextchannel=1b35861dca6d1210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">California</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1b35861dca6d1210VgnVCM1000006ce1680aRCRD&vgnextchannel=1b35861dca6d1210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">Colorado</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1b35861dca6d1210VgnVCM1000006ce1680aRCRD&vgnextchannel=1b35861dca6d1210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">Idaho</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1437577ec605e210VgnVCM1000006ce1680aRCRD&vgnextchannel=1437577ec605e210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">Iowa</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1b35861dca6d1210VgnVCM1000006ce1680aRCRD&vgnextchannel=1b35861dca6d1210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">Kansas</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1b35861dca6d1210VgnVCM1000006ce1680aRCRD&vgnextchannel=1b35861dca6d1210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">Minnesota</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1b35861dca6d1210VgnVCM1000006ce1680aRCRD&vgnextchannel=1b35861dca6d1210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">Missouri</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1b35861dca6d1210VgnVCM1000006ce1680aRCRD&vgnextchannel=1b35861dca6d1210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">Nebraska</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1b35861dca6d1210VgnVCM1000006ce1680aRCRD&vgnextchannel=1b35861dca6d1210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">Nevada</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1437577ec605e210VgnVCM1000006ce1680aRCRD&vgnextchannel=1437577ec605e210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">New Mexico</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1b35861dca6d1210VgnVCM1000006ce1680aRCRD&vgnextchannel=1b35861dca6d1210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">North Dakota</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1b35861dca6d1210VgnVCM1000006ce1680aRCRD&vgnextchannel=1b35861dca6d1210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">Oklahoma</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1b35861dca6d1210VgnVCM1000006ce1680aRCRD&vgnextchannel=1b35861dca6d1210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">Oregon</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1b35861dca6d1210VgnVCM1000006ce1680aRCRD&vgnextchannel=1b35861dca6d1210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">South Dakota</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1b35861dca6d1210VgnVCM1000006ce1680aRCRD&vgnextchannel=1b35861dca6d1210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">Utah</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1b35861dca6d1210VgnVCM1000006ce1680aRCRD&vgnextchannel=1b35861dca6d1210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">Washington</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1b35861dca6d1210VgnVCM1000006ce1680aRCRD&vgnextchannel=1b35861dca6d1210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">Wisconsin</a></li><li><a href="vgn_ext_templ_rewrite?vgnextoid=1b35861dca6d1210VgnVCM1000006ce1680aRCRD&vgnextchannel=1b35861dca6d1210VgnVCM1000006ce1680aRCRD/vgn_ext_templ_rewrite#checkcompare">Wyoming</a></li></ul>

<input name="compare-savings" value="" type="hidden"></div>
</form>
<!--<div class="comparison-chart-close" onclick="$('comparison-container').hide();"></div>-->

</h2>

<div id="comparison-container">
	<div style="text-align:center; padding-bottom: 50px"><img src="/static_files/botw2/home/personal-banking/checking-accounts/images/compare-default.jpg" style="margin: 50px auto 0; width: 257px;" /></div>
    <!-- new mexico, iowa -->
    
</div>
ASKER CERTIFIED SOLUTION
Kim Walker
Senior Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros