title: A bookmarklet code to send a same message each time in IM
body: <p>I am looking to create a bookmarklet were it can send the same message each time.
  I am using amazon chime as IM</p>
  <p>When a bookmarklet is clicked, it will auto type a message (shown below in image2) and then it must auto hit send button</p>
  <pre><code>  document.getElementsByClassName(&quot;public-DraftStyleDefault-ltr&quot;)[0].getElementsByTagName('span')[0].innerHTML = '&lt;span data-text=\&quot;true\&quot;&gt;Hey! This is Greg. How may I help you today. Please be advised that this chat is confidential and you agree to terms of XXXX company&lt;/span&gt;';
  </code></pre>
  <p><a href="https://i.stack.imgur.com/cb4oy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cb4oy.png" alt="enter image description here" /></a></p>
  <p>after I click the bookmarklet it must send the message</p>
  <p><a href="https://i.stack.imgur.com/uYG9L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uYG9L.png" alt="enter image description here" /></a></p>