Aşağıdaki php uygulamasını nasıl js olarak çalıştırabilirim?
$hesapla = $sayi1 * (1+($sayi2/100));Teşekkürler.
7
●616
function hesapla()
{
sayi1 = parseInt(document.form1.alan1.value);
sayi2 = parseInt(document.form1.alan2.value);
document.getElementById("sonuc").innerHTML=ayi1*(1+(sayi2/100));
}
<form name="form1">
<input type="text" name="alan1" /> <br />
<input type="text" name="alan2" />
<a href="javascript:;" onclick="javascript:hesapla()">Topla</a>
<div id="sonuc"></div>
</form> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Sonucu otomatik göster</title>
<script>
function hesapla()
{
sayi1 = parseInt(document.form1.alan1.value);
sayi2 = parseInt(document.form1.alan2.value);
document.getElementById("hesapla").innerHTML=$sayi1*(1+($sayi2/100));
}
</script>
</head>
<body>
<form name="form1">
<input type="text" name="alan1" /> <br />
<input type="text" name="alan2" />
<a href="javascript:;" onclick="javascript:hesapla()">Topla</a>
<div id="sonuc"></div>
</form>
</body>
</html>
İşi uzmanından almak başka. Sağolasın.