This is an example of using Javascript to implement the Newton-Raphson algorithm. The function f and its derivative are in the script.
Type in an initial guess for the root and every time you press the "Calculate" button you will get back an improved root.