This is my html button :
<button type="button" class="button-reset" id="showEditPanel"><i class="clip-checkmark-2"></i>Edit Weather</button>
here's what i have done so far :
$(document).ready(function() {
var btn = $('#showEditPanel');
btn.click(function () {
if (btn.val() === "Edit Weather") {
btn.val("Cancel Edit");
$("#showMe").slideToggle("medium", "swing");
$('#EdTemperature , #EdDirection , #EdHumidity, #EdPrecipitation, #EdStatus').val('');
} else {
btn.val("Edit Weather");
$("#showMe").slideToggle("medium", "swing");
}
});
});
I want , when a user clicks that button its text must change to :
<button type="button" class="button-reset" id="showEditPanel"><i class="clip-tick-2"></i>Cancel Edit</button>
then again when it is click it reverts back to :
<button type="button" class="button-reset" id="showEditPanel"><i class="clip-checkmark-2"></i>Edit Weather</button>