Using Textbox.io - Get Editor Instances
HTML
<script src="https://s3.amazonaws.com/ephox-static-ephox-com/jsfiddle/textboxio/textboxio.js"></script>
<div class="editableDiv">
<p>First div content.</p>
</div>
<div class="editableDiv">
<p>Second div content.</p>
</div>
<div class="editableDiv">
<h1>
Test
</h1>
<p>Third div content.</p>
</div>
<button id="getEditors">Get All Editor Contents</button>
CSS
.editableDiv {
margin:10px 0;
height:200px;
}
JavaScript
// Create a Textbox.io Editor for the matched element(s)
textboxio.replaceAll('.editableDiv');
document.getElementById('getEditors').onclick = function() {
// Get an array of editors matching a selector
var editors = textboxio.get('.editableDiv');
// Iterate over the editors array
editors.forEach(function(ed){
// Alert the content of each editor
var content = ed.content.get();
alert(content);
});
};