title: Changing button value on button click
body: <p>Just starting out in Xpages and ran into a silly problem:</p>
  
  <p>I have a button (id- "button2") and it has label "aaa". What I'm trying to do is to change the value of the button on the button click to value "kappa123". I've included my JavaScript in the "Client" tab in Script Editor.</p>
  
  <p>JavaScript:</p>
  
  <pre><code>var elem = document.getElementById("button2");
  if (elem.value=="aaa") elem.value="kappa123";
  else elem.value = "aaa";
  </code></pre>
  
  <p>I don't even a error and nothing happens. What am I doing wrong?</p>