Custom jQuery help needed

We are trying to relocate the quantity input within our product page from the bottom to beside the product title using jQuery. This is the following code that we’re trying:

jQuery( document ).ready(function($) {
$('div.quantity').insertBefore(' div.wc-pao-col2');
});

It works fine, except when we click on the quantity input, it disappears. Could you please take a look and suggest modifications if possible?