How to update a product's price automatically when a visitor enters the product's quantity on the frontend product page?

I would like to update product price based on quantity. When user update the quantity, price will be multiply based on the added quantity.
Also How can I get the price, custom option object in javascript ?