/    Sign up×
Community /Pin to ProfileBookmark

What’s not right

Hello ! I can’t find a mistake in this simple code!!
unfortunately id doesn’t do what I need
It supposed to receive 2 numbers and throw an alert with a multiplication of those numbers.
pls point me to a mistake
thanks!
<html>
<head>
<title> Test </title>

</head>
<body>
<h1 align= “center”> Calc </h1>
<br>
<script language=”JavaScript”>
function mult()
{
var a= document.Calc.li1.value;
var b= document.Calc.li2.value;
var c= (a*b);
alert(“the answer is :”+c);
}
</script>
<input type=”text” id=”li1″ name=”L1″>
<br>
<input type=”text” id= “li2″name=”L2”>
<br>

<input type=”submit” name=”sbm” value=”go” onclick= “mult()”>
<br>

</body>
</html>

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@AlphaBravoXOct 22.2010 — [CODE]
var a= parseInt(document.getElementById('li1').value);
var b= parseInt(document.getElementById('li2').value);
[/CODE]
Copy linkTweet thisAlerts:
@g0gaauthorOct 24.2010 — Thank you very much!

if it's possible, is there any site to show all the possible commands for javascript and html???
×

Success!

Help @g0ga spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...