2
Hello, I was doing a javascript test to see if the value of two inputs were different, if they were I would change the background from an input to red, and I tried opening the style tags inside the if and instead of appearing like this
appears like this
javascript code
function verificarIgual()
{
var senha = document.getElementById('senha_cadastro');
var confirmar = document.getElementById('confirmarsenha_cadastro');
if(senha.value != confirma.value)
{
<style>
</style>
}
}
That input I want to turn red
<tr>
<td id="design_geral_escrita" height="22" align="left">
<label for="senha_cadastro"></label>
<input width="200" type="text" name="senha_cadastro" id="senha_cadastro" /></td>
</tr>
Just to tell you, you’re on the wrong track. Hehe. I’ll try to help you. Which
input
you want to leave with red background?– Fernando Leal
I put the input in the question
– Lucas Caresia
What you have inside the if is a syntax error in Javascript, and it stops the execution of the code. You cannot mix HTML and JS like this.
– bfavaretto