Calculate a field on client side using user input

Calculate a field on client side using user input

I have 2 custom fields in invoice called Height and Width. I want to calculate Area based on user input on client side. How is this possible?