Skip to content
TheChatArchiveThe Chat Archive
gpt-4-0314· OpenAIHugging Face Arena Human Preference 55K

please create a bookmrklet that counts the words of selected text and show them in a…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with gpt-4-1106-preview’s answer.
  1. User

    please create a bookmrklet that counts the words of selected text and show them in a message

  2. Assistant

    To create a bookmarklet that counts the words of selected text and shows them in a message, follow these steps:

    1. Create a new bookmark in your browser. You can do this by right-clicking on the bookmarks toolbar and selecting "Add Page" or "Add Bookmark" (the wording might be different depending on your browser).

    2. Name the bookmark "Word Counter" or any other name you prefer.

    3. In the URL or Location field, paste the following JavaScript code:

    javascript:(function(){var t=window.getSelection().toString().trim().replace(/(\r\n|\n|\r)/gm,' ').split(/\s+/).length;alert('Word count: '+t);})();
    
    1. Save the bookmark.

    Now, whenever you want to count the words of selected text, simply select the text and click the "Word Counter" bookmarklet. A message will appear with the word count.

    Please note that this bookmarklet may not work on certain websites due to security restrictions.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.