Skip to content

Comment on Why OCaml, Why Now?parent

Comments

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');
    ]
  });

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

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.