Re-size HTML textarea element with CodeMirror - Javascript CodeMirror

Javascript examples for CodeMirror:Configuration

Description

Re-size HTML textarea element with CodeMirror

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <style id="compiled-css" type="text/css">

.CodeMirror {//  w w w  .j  a va 2s  .  c  o m
   position: relative !important;
   height: 100% !important;
}
html, body{
   min-height: 100%;
   position: relative;
   height: 100%;
}


      </style> 
      <script type="text/javascript">
    window.onload=function(){
  var textArea = document.getElementById('textArea');
  CodeMirror.fromTextArea(textArea, {
    lineNumbers: true
  });
    }

      </script> 
   </head> 
   <body> 
      <link href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.15.2/codemirror.css" rel="stylesheet">  
      <textarea id="textArea"></textarea> 
      <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.15.2/codemirror.js"></script>    
   </body>
</html>

Related Tutorials