I am trying to do a copy to clipboard action by using below code, and the code works fine in desktop browsers but when it comes to mobile browsers like IOS safari/chrome the page scrolls down at $temp.val(copydatacode).select();
$('#myelementcopy').click(function(event){
var copydatacode= $('.addelement').html();
var $temp = $("<input>");
$("body").append($temp);
$temp.val(copydatacode).select(); // when the code execute at this line the mobile browser jumps to the page bottom
document.execCommand("copy");
$temp.remove();
return false;
event.preventDefault();
});