Menu
I want to display one of two values either “b” or “f”
If “f=0” I want to display “b” and if not i want to display “f”
below is my code but its not working?
<script type=”text/javascript”>
function a_div_b(form) {
a=eval(form.a.value)
b=eval(form.b.value)
c=a/b
d=(Math.floor(a/b))
e=b*d
f=a-e
if (f=0)
{
form.ans.value = b
}
else
{
form.ans.value = f
}
}
</script>