Within my vertical menu, there are 5 items including web design and mobile app. When clicked on these items, they reveal their respective href attributes as shown below.
<div class="col-md-3">
<ul class="nav nav-tabs nav-stacked">
<li class="active">
<a href="#web" onclick="webdesDiv()">Web Design and Development</a> </li>
<li><a href="#mob" onclick="mobileDiv()">Mobile Application Development</a></li>
<li><a href="#ecom" onclick="ecommDiv()">eCommerce Solutions </a></li>
<li><a href="#soft" onclick="softDiv()">Software Development</a></li>
<li><a href="#supp" onclick="supportDiv()">Support & Maintenance</a></li>
</ul>
</div>
<div class="col-md-9" style="display:none;" id="webdesc">
<h4>View our Web Design page here</h4>
<p>Discover a secure and interactive eCommerce storefront that boosts your product sales through cutting-edge coding techniques.</p>
</div>
<div class="col-md-9" style="display:none;" id="mobdesc">
<h4>Explore our Mobile App section here</h4>
<p>Experience a secure and interactive eCommerce storefront that enhances your product sales using top-tier coding methods in the industry.</p>
</div>
An issue arises when clicking on options like ecommerce solutions, as the result gets appended to the current page instead of displaying only the specific description. How can I rectify this behavior? Any suggestions for fixing my code?
Below is my JavaScript code:
<script>
function mobileDiv()
{
document.getElementById('mobdesc').style.display = "block";
}
function webdesDiv()
{
document.getElementById('webdesc').style.display = "block";
}
</script>