algebra.js is a javascript library to build, display and solve algebraic equations. The main objects available are Fraction, Expression, and Equation.
Website Demo