Add placeholder string to your Codemirror editor
Learn how to add a placeholder string into your Codemirror editor. Placeholder is the text that appears in the editor when it’s empty and not focused.
We have already seen how to add CodeMirror editor into a TextArea element in this post. You can easily add a placeholder string to your CodeMirror editor using the placeholder plugin from the official CodeMirror repository.
Download the placeholder plugin and import it to your html.
Add the placeholder text to your textarea.
<textarea id="code" name="code" placeholder="Please enter your address here..">
You can see the placeholder string in the editor.