Hello, I'm blocked to perform an action with jQuery.
I have this:
<div>
<p>
Password: <span id="passwordServer">*********</span>
<b><i id="togglePasswordServer" class="unhide icon"></i></b>
</p>
</div>
<script>
$(document).ready(function(){
var passwordServer = "123456";
$("#passwordServer").text(passwordServer);
});
</script>
Basically what I want to do is the password appears hidden as long as it is not pressed in the label and I have been investigating and it shows that with the function longclick
but it is with a plugin external to jQuery .
The password that is stored in the variable would not be seen until the with passwordServer
is pressed ; if you stop pressing it, it shows the .i
id="togglePasswordServer
*****
You can use the
mousedown
and eventsmouseup
to detect when you click on the element in question and when you move the mouse away from it.In this case I use a
input
instead of aspan
to make it easier.Example:
If I haven't misunderstood you, what you want to do is something like this:
This might help you, good luck...
Example: