複製元素內容到剪貼板

$("#exapi_grid").find(".command-copy").on("click", function(e)
	{
		apiid = $(this).data("row-id");
		apikey = $(this).closest('tr').children('td:eq(2)').text();	
		var oInput = document.createElement('input');//'textarea'
		oInput.value = apikey;
		document.body.appendChild(oInput);
		oInput.select(); 
		document.execCommand("Copy"); 
		oInput.className = 'oInput';
		oInput.style.display='none';
		alert('Key copied to clipboard');
					
	});

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章