If you want to do this, then you would probably make it either a block plugin or an atto editor plugin. Making a block plugin might be a little easier. If you look at the Generico example that Al and Richard mentioned then that might get you started with the javascript part.
General developer forum
Calculator For Moodle
This discussion has been locked so you can no longer reply to it.