javascript が動作しません。
試しにキーダウンを検知したらalertが出る様にしましたが動作しませんでした。
どの様な解決方法がありますか?
javascript
1<html> 2<script> 3window.onload=function(){ 4 document.getElementById("wpTextbox1").addEventListener('keydown',function(){ 5//キーダウンしたらalertが出る? 6alert(document.editform.wpTextbox1.value); 7 keydown1(); 8 }); 9} 10function keydown1(){ 11 12var code = "<div style='border: 2px solid #008080; width: 90%; height:auto; margin:10px; padding:10px; border-radius:10px; moz-border-radius: 10px; webkit-border-radius: 10px'>\n\n</div>"; 13document.editform.wpTextbox1.value=document.editform.wpTextbox1.value.replace(/##/g, code)); 14 15 16 } 17 18 19 20 21 22</script> 23<form name="editform"> 24<input type="text" id="wpTextbox1" name="wpTextbox1" value="#" ><br> 25</form> 26</html>
回答4件
あなたの回答
tips
プレビュー