Sorry, my Jquery is WEAK!
But here’s what i have….
$(function () {
if (document.calc.loan.value > 1000)
{
("#link").value = "<a href='dump'></a>";
}
else {
("#link").value = "<a href='dump2'></a>";
}
});
<form name=calc method=POST>
<input type=text name=loan id="amount" />
<div id="link"></div>
</form>
So I want the content of #link to change if the Loan Input is over 1000 as they type
Just use
.html()like below to modify the content of the div.Also you were missing
$. Changed('#link')->$('#link')I just noticed that you want as he types in the input field. In that case you need an
onkeyupevent handler to check the value typed in the input box.Edit: Changed from
onchangetoonkeyup.