I’ve attached a ‘click’ event to a ‘button’ element (type=submit) so that clicking on the latter element copies data from one field (input type=text) to another. However, the copy is only temporary and reverts to blank or default values.
Affecting Firefox/Opera/Chrome
When the submit button is clicked, it also submits the form, which causes a page refresh.
You’ll have to
return falsefrom your click event handler: