change javascript math problem into jquery

change javascript math problem into jquery

I have the following javascript code
  1. <script type ="text/javascript">
  2.   function dti()
  3. {
  4.         var tim = (document.form.debt.value - 0) / (document.form.income.value - 0) * 100;
  5.         document.form.solution.value = Math.round(tim);
  6.     }
  7. </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.