0
There is a register field of an employee called senha
of which there is a button called "Ver senha"
that lets you see the user password, only I want to remove the button Ver senha
I did in javascript and wanted to know how to replace this <button>
by an icon called olho.png
better match with the field (issue of affordance).
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<title> Cadastrar Funcionário </title>
<link rel="stylesheet" href="/WEB/css/css.css">
<script>
function mostrarSenha(){
var tipo = document.getElementById("senha")
if (tipo.type == "password") {
tipo.type = "text";
}else{
tipo.type = "password";
}
}
</script>
</head>
<body>
<form method="POST">
<p> Senha: <input type="password" name="senha" id="senha" size=30 maxlength="32" required="">
<button type="button" onclick="mostrarSenha()"> Ver senha</button> </p>
</form>
caminho da imagem da qual eu quero substituir o <button> por um <img>: img/olho.png
pq does not put
background: url('img/olho.png')
in the css that defines the button?– Ricardo Pontual
You can show me in code?
– Fujjin
yes, see the answer
– Ricardo Pontual
If I understand what you want to do, I find a solution with more pleasant svg, like that one. When I needed to do it, I used it as a reference and adapted it to my need :)
– Rafael Tavares
@Rafaeltavares interesting that code.
– Fujjin