以下の隠しinputタグの値「world」をクリップボードに入れるにはどのように記述すればいいでしょうか?
html
1<!DOCTYPE html> 2<html> 3<head> 4 <meta charset="UTF-8"> 5 <script> 6 var toClipBoard = function(id){ 7 var input = document.getElementById(id); 8 alert(input.value); 9 } 10 </script> 11</head> 12<body> 13<input type="hidden" id="hello" value="world"> 14<button onclick="toClipBoard('hello')">クリック!</button> 15</body> 16</html>
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/03/30 08:46