On my website, I have a navigation bar that changes the contents of a div when a user clicks on an item. However, if the user clicks multiple times in quick succession, the content changes too many times. I want to ensure that the content only changes once, even if the user clicks rapidly.
Any assistance with this issue would be greatly appreciated.
EDIT:
I am utilizing a Bootstrap menu with an onclick attribute to modify content as needed.
HTML
<ul class="nav nav-tabs">
<li><a href="#" onclick="changeContent(this)">Home</a></li>
<li><a href="#" onclick="changeContent(this)">Menu 1</a></li>
<li><a href="#" onclick="changeContent(this)">Menu 2</a></li>
<li><a href="#" onclick="changeContent(this)">Menu 3</a></li>
</ul>
JS
function changeContent(item){
//changing parent content-just for demo
$(this).parent.html("Some content");
}
When a user quickly clicks on an item multiple times, the content will update each time. My goal is to have the content change only once, regardless of how many rapid clicks occur.