How to toggle HTML text of an anchor tag using jQuery? I want an anchor that when clicked the text alternates between Show Background & Show Text
Show Background
Show Text
var el = $('#someSelector'); el.text(el.text() == 'view more' ? 'view less' : 'view more');