copy to clipboard and how exactly pass the value to the Javacript {php var}

*Hello I was designing a form to take some value in the given fileds and return the whole as a "DRAFT"
once the user fills the form clicks copy to clipboard the whole draft has to be copied ,if he/she clicks clear button the all fields has to be cleared ...... im trying to achieve this by using javascript ! kindly guide .. very new to php
*