See if input and span is the same
Hi,
I have following html:
<span id="results">xxxx</span>
<input id="input_here" type="text"name="UserInput"></input>
If #results has the same value as input_here I would like to alert a message.
If there would be two inputs there wouldnt be any problem.
But if results have for example the value 5 and I put in 5 into input_here I want an alert.
I have tried to do different if else but can't get it to work.
if(parseInt($("#input_here").val()) == $(parseInt("#results").html()) {
{
$("#used").html("number already used");
} else {
$("#guess").html("....");
}
}
});
Kinda new with Jquey and javascript so would appreciate some help.
thx