how to change the text using jquery on click

Solutions on MaxInterview for how to change the text using jquery on click by the best coders in the world

showing results for - "how to change the text using jquery on click"
Aby
26 Apr 2020
1$(document).ready(function () {
2    $("#fold").click(function () {
3        $("#fold_p").fadeOut(function () {
4            $("#fold_p").text(($("#fold_p").text() == 'Fold it') ? 'Expand it' : 'Fold it').fadeIn();
5        })
6    })
7});
8