change javascript math problem into jquery
I have the following javascript code
- <script type ="text/javascript">
-
function dti()
-
{
-
var tim = (document.form.debt.value - 0) / (document.form.income.value - 0) * 100;
-
document.form.solution.value = Math.round(tim);
-
}
- </s cript>
How can I convert that into Jquery I have tried the following but it doesn't work
<script type ="text/javascript">
function dti() {
var tim = parseInt($( "#debt" ).text(), 10) / parseInt($( "#income" ).text(), 10)*100;
$(
"#solution" ) = Math.round(tim).val();
}
</script
>
when i try the jquery version i don't get a value; there is obviously something wrong here any guess.