Hacker News new | ask | show | jobs
by jarrett 4475 days ago
You do it all the time in web apps. For example, changing the text of a toggle link between "show" and "hide." For example, with jQuery:

  $('#toggleLink').click(function() {
    if ($('#toggleLink').html() == 'Show') {
      showRollout();
      $('#toggleLink').html('Hide');
    } else {
      hideRollout();
      $('#toggleLink').html('Show');
    ]
  });
1 comments

I think you misread something. He asked how to do it without manipulating the DOM.