Skip to main content
added 300 characters in body
Source Link
user34073
user34073

Beyond not having the basic framework for the HTML, you have one error according to the W3C validator:

<input id="display" value="0" size="15" readonly="true" >

readonly="true" is not valid, the correct attribute is readonly="readonly"

There is a pretty bad UI problem here. When you click the buttons as follows 9 - 3 = 2, the calculator reads 62, whereas it should reset and only read 2 because you clicked the = button.


Beyond this, your calculator does not follow the order of operations. Probably the simplest way to handle this would be to only update the calculation when the +, -, and = buttons are pressed (like the Windows calculator does), parsing and calculating everything else from the stack.

Beyond not having the basic framework for the HTML, you have one error according to the W3C validator:

<input id="display" value="0" size="15" readonly="true" >

readonly="true" is not valid, the correct attribute is readonly="readonly"

There is a pretty bad UI problem here. When you click the buttons as follows 9 - 3 = 2, the calculator reads 62, whereas it should reset and only read 2 because you clicked the = button.

Beyond not having the basic framework for the HTML, you have one error according to the W3C validator:

<input id="display" value="0" size="15" readonly="true" >

readonly="true" is not valid, the correct attribute is readonly="readonly"

There is a pretty bad UI problem here. When you click the buttons as follows 9 - 3 = 2, the calculator reads 62, whereas it should reset and only read 2 because you clicked the = button.


Beyond this, your calculator does not follow the order of operations. Probably the simplest way to handle this would be to only update the calculation when the +, -, and = buttons are pressed (like the Windows calculator does), parsing and calculating everything else from the stack.

deleted 1 character in body
Source Link
user34073
user34073

Beyond not having the basic framework for the HTML, you have one error according to the W3C validator:

<input id="display" value="0" size="15" readonly="true" >

readonly="true" is not valid, the correct attribute is readonly="readonly"

There is a pretty bad UI problem here. When you click the buttons as follows 9 - 3 = 2, the calculator reads 62, whereas it should reset whenand only read 2 because you click a button after clickingclicked the = button.

Beyond not having the basic framework for the HTML, you have one error according to the W3C validator:

<input id="display" value="0" size="15" readonly="true" >

readonly="true" is not valid, the correct attribute is readonly="readonly"

There is a pretty bad UI problem here. When you click the buttons as follows 9 - 3 = 2, the calculator reads 62, whereas it should reset when you click a button after clicking the = button.

Beyond not having the basic framework for the HTML, you have one error according to the W3C validator:

<input id="display" value="0" size="15" readonly="true" >

readonly="true" is not valid, the correct attribute is readonly="readonly"

There is a pretty bad UI problem here. When you click the buttons as follows 9 - 3 = 2, the calculator reads 62, whereas it should reset and only read 2 because you clicked the = button.

Source Link
user34073
user34073

Beyond not having the basic framework for the HTML, you have one error according to the W3C validator:

<input id="display" value="0" size="15" readonly="true" >

readonly="true" is not valid, the correct attribute is readonly="readonly"

There is a pretty bad UI problem here. When you click the buttons as follows 9 - 3 = 2, the calculator reads 62, whereas it should reset when you click a button after clicking the = button.