I'd like to do the following. I got a button like this:
<button class="uk-button uk-position-bottom" onclick="search.start()">Start search</button>
The JS part is this:
var search = new SiteSearch();
Now I'd like to do this:
Once clicked, the label of the button should show Stop search. And the called function should be search.stop(). If the user clicks Stop search, the button should be the Start search button again.
How can I do this in an elegant way?
search.stop()method available? Is there any documentation you should have linked to that would help us understand whatSiteSearch()is? What have you tried, how did it fail? What went wrong? How do you define 'elegant'?