title: How can I show entered password using tooltip on input type=password in bootstrap?
body: <p>How can I display the "Password entered by the user" on the tooltip placed on the input element <code>type=password</code>, only if the "Show Password" checkbox is selected. ?</p>
  
  <p>what I am trying to achive is.</p>
  
  <p>if user checks the checkbox "Show Password"
  then the password should be visible in the plaintext using the tooltip.</p>
  
  <p>so far I have done like this.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form&gt; 
      &lt;span class="form-label"&gt;Password&lt;/span&gt;
      &lt;input type="password" id="password" class="form-control" style="width:350px;" placeholder="Password" data-toggle="tooltip" data-placement="right" title="" required&gt;
      &lt;div class="checkbox"&gt;
      &lt;label&gt;&lt;input type="checkbox" id="show-password" onClick="javascript:showPassword(this)"&gt;Show Password&lt;/label&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>JAVASCRIPT</strong></p>
  
  <pre><code>function showPassword(obj) {
      if (obj.checked) {
          /* checkmark is checked*/
  
          /*show tooltip*/
          $('#password').tooltip('show');
  
          /*create onkeyup event so the tooltip changes as the password changes.*/
          $("#password").keyup(function () {
              var entered_password = document.getElementById("password").value;
              $("#password").attr("title", entered_password);
              $("#password").tooltip('fixTitle');
          });
      } else {
          //hide the tooltip//
      }
  }
  </code></pre>
  
  <p><strong>CSS</strong></p>
  
  <pre><code>@import url("http://maxcdn.bootstrapcdn.com/bootswatch/3.2.0/cerulean/bootstrap.min.css");
  @import url("http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css");
  </code></pre>
  
  <p><strong><a href="http://jsfiddle.net/834Nj/1/" rel="nofollow">http://jsfiddle.net/834Nj/1/</a></strong></p>
  
  <p>so far its only working if I select and reselect the checkbox but not as I type the password.</p>