I am having trouble with the code I found on a page about toggling text using jQuery from this link.
Could someone please explain to me the significance of ':visible'? Thank you.
Here is the fiddle link, and below is the code that I copied.
HTML:
<button id="more-less-options-button">more options</button>
JS
$("#more-less-options-button").click(function() {
var txt = $("#extra-options").is(':visible') ? 'more options' : 'less options';
$("#more-less-options-button").text(txt);
$("#extra-options").slideToggle();
});