回答編集履歴

1

コードの追加

2016/11/04 06:39

投稿

nobinobi
nobinobi

スコア199

test CHANGED
@@ -59,3 +59,69 @@
59
59
 
60
60
 
61
61
  作成されたリッチエディタの情報を載せると他の回答が得られると思いますよ。
62
+
63
+
64
+
65
+
66
+
67
+ ---
68
+
69
+
70
+
71
+
72
+
73
+ **コード追加**
74
+
75
+ ```
76
+
77
+ <html>
78
+
79
+ <head>
80
+
81
+ </head>
82
+
83
+ <body>
84
+
85
+ <script type="text/javascript">
86
+
87
+ function myClicked() {
88
+
89
+ var edit_value = document.getElementById('cursor').value;
90
+
91
+ //var edit_value = document.getElementsByClassName('edit_area');
92
+
93
+ var textarea_str = edit_value;
94
+
95
+ //var textarea_str = edit_value[0];
96
+
97
+ document.example_form.example_textarea.value = textarea_str;
98
+
99
+ //document.example_form.example_textarea.value = textarea_str.innerHTML;
100
+
101
+ }
102
+
103
+ </script>
104
+
105
+
106
+
107
+ <form name="example_form">
108
+
109
+ <div id="edit_area" class="edit_area"><input type="text" id="cursor" class="cursor"></div>
110
+
111
+ <div class="edit_area" style="visibility:hidden;"><span style="font-size:20px;color:#00FF00;">hoge</span></div>
112
+
113
+ <div id = "myClickee" onclick="myClicked();">ここをクリック!</div>
114
+
115
+ <textarea id="sample" name="example_textarea"></textarea>
116
+
117
+ <p id="log"></p>
118
+
119
+ </form>
120
+
121
+
122
+
123
+ </body>
124
+
125
+ </html>
126
+
127
+ ```