/*$(".btn").click(function() {
$(".myText").toggle();
});*/
// OR
$(".btn").click(function() {
var lable = $(".btn").text().trim();
if(lable == "Hide") {
$(".btn").text("Show");
$(".myText").hide();
}
else {
$(".btn").text("Hide");
$(".myText").show();
}
});
<style>
.btn {
width: 120px;
height: 50px;
}
</style>
<button class="btn">
Hide
</button>
<p class="myText">
You can hide and show me again.
</p>