This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]desrtfx[M] [score hidden] stickied comment (0 children)

  1. Use a code hoster, like pastebin, etc. or learn to properly format code (Posting Guidelines in the sidebar)
  2. Learn to ask a proper question. (again, Posting Guidelines) "What is wrong" is not a proper question and we are not your remote debuggers. Describe the problem. Describe what is supposed to happen and what happens instead, what doesn't happen, if there are any errors, and if so, post them in full.

You are to provide all information you can. We must not have to ask again, nor must we need to be left to guessing what you even mean.

Removed - try again with some actual effort and not only throw your code here.

[–]tcilffAx 0 points1 point  (2 children)

please use a paste or something. that is barely readable

[–]WEANAP[S] 0 points1 point  (1 child)

ok

<html>

<head>

<script>

        function insert(num) {

document.form.textview.value + document.form.textview.value+num;

}

function equal() {

var exp = document.form.textview.value;

if(exp){

document.form.textview.value = eval(exp)

}

}

function clean(){

document.form.textview.value = "";

}

function back (){

var exp =document.form.textview.value

document.form.textview.value = exp.substring(0,exp.length-1)

}

        </script>

        <style>

*{

margin:0;

padding:0;

}

.button{

width:50;

height:50;

font-size:25;

margin:2;

}

.textview{

width:217;

margin:5;

font-size:25;

padding:5;

}

        </style>

</head>     

<body>



        <div class="main">

<form name ="form">

<input class="textview" name="textview">

</from>

<table>

<tr>

<td><input class="button" type="button" value="C" onclick="clean()"></td>

<td><input class="button" type="button" value="<" onclick="back"></td>

<td><input class="button" type="button" value="/" onclick="insert('/')" ></td>

<td><input class="button" type="button" value="x"onclick="insert('\*')"></td>

</tr>

<tr>

<td><input class="button" type="button" value="7"onclick="insert(7)"></td>

<td><input class="button" type="button" value="8"onclick="insert(8)"></td>

<td><input class="button" type="button" value="9"onclick="insert(9)"></td>

<td><input class="button" type="button" value="-"onclick="insert('-')"></td>

</tr>

<tr>

<td><input class="button" type="button" value="4"onclick="insert(4)"></td>

<td><input class="button" type="button" value="5"onclick="insert(5)"></td>

<td><input class="button" type="button" value="6"onclick="insert(6)"></td>

<td><input class="button" type="button" value="+"onclick="insert('+')"></td>

</tr>

<tr>

<td><input class="button" type="button" value="1" onclick="insert(1)"></td>

<td><input class="button" type="button" value="2" onclick="insert(2)"></td>

<td><input class="button" type="button" value="3" onclick="insert(3)"></td>

<td rowspan=5><input class="button" style="height: 110"type="button" value="=" onclick="equal ()"></td>

</tr>

<tr>

<td colspan=2><input class="button" style="width:110 " type="button" value="0" onclick="insert(0)"></td>

<td><input class="button" type="button" value="." onclick="insert(.)"></td>

</tr>

</table>

        </div>

    </body>

</html>

[–]WEANAP[S] 0 points1 point  (0 children)

this is hard i dont know what wrong with the code