How can I change the text [+ Add] when I click on the drop-down menu and show it [X Cancel]
But to understand what I want to achieve, this is what I show in the following two images.


$(function() {
$('.expand-one').click(function(){
$('.content-one').slideToggle('fast');
});
});
.expand-one {
color: #4D8FE5;
cursor: pointer;
font-size: 14px;
}
.content-one {
clear: both;
display:none;
}
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<div class="sitesection">
<span class="expand-one">+ Add</span>
<div class="content-one"><input type="text" /></div>
</div>
Run codeHide result
source
share