回答編集履歴

1

sample

2018/07/03 01:31

投稿

yambejp
yambejp

スコア114829

test CHANGED
@@ -5,3 +5,49 @@
5
5
  どういった出力をするかはユーザーが好きにすればいいでしょう。
6
6
 
7
7
  HTMLとして出力すれば任意のスタイルシート適用することも可能です
8
+
9
+
10
+
11
+ # sample
12
+
13
+
14
+
15
+ ```javascript
16
+
17
+ <style>
18
+
19
+ #out{
20
+
21
+ color:red;font-size:5em;font-weight:bold;font-style:italic;text-decoration:underline;
22
+
23
+ }
24
+
25
+ </style>
26
+
27
+ <script>
28
+
29
+ window.addEventListener('DOMContentLoaded', function(e){
30
+
31
+ document.querySelector('#in').addEventListener('click',function(e){
32
+
33
+ var str=prompt("入力してください");
34
+
35
+ if(str){
36
+
37
+ document.querySelector('#out').textContent=str;
38
+
39
+ }
40
+
41
+ });
42
+
43
+ });
44
+
45
+ </script>
46
+
47
+
48
+
49
+ <input type="button" value="入力" id="in">
50
+
51
+ <div id="out"></div>
52
+
53
+ ```