Jquery calculator
- by Nemanja
I want to make calculator for summation.
I have this jquery code:
<script type="text/javascript">
$(document).ready(function() {
$("#calculate").click(function() {
if ($("#input").val() != '' && $("#input").val() != undefined) {
$("#result").html("Result is: " + parseInt($("#input").val()) * 30 );
}
else
{
$("#result").html("Please enter some value");
}
}); });
</script>
<div id="calculator">
<br />
<input type="text" style="left:20px;" id="input" />
<div id="result"></div>
<input type="button" id="calculate" value="calculate" style="left:20px;" />
</div>
I want something like this:
I write number 5, then input + from keyboard and write another value.
Then to click on summation button and to get value.
Can anyone help me with this?
Thank you very much!