You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you apply styling to all of the text in an editor and then call the value method, you will not get the styling because it is applied to the editor div instead of to a span within the editor.
A possible fix is to have another inner div within the editor, whose innerHTML we return instead of that of the editor itself.
Examples:
Note: arte = $(".editor").Arte()
Bolding all of the text in the editor:
arte.get(0).value() returns "Please enter text ..."
$(".editor")[0].innerHTML is <div contenteditable="true" class="" style="height: 200px; width: 300px; overflow: auto; border: 1px dashed gray; font-weight: bold;">Please enter text ...</div>
Bolding only the word enter:
arte.get(0).value() returns "Please <span style="font-weight: bold;">enter</span> text ..."
$(".editor")[0].innerHTML is <div contenteditable="true" class="" style="height: 200px; width: 300px; overflow: auto; border: 1px dashed gray;">Please <span style="font-weight: bold;">enter</span> text ...</div>
The text was updated successfully, but these errors were encountered:
If you apply styling to all of the text in an editor and then call the
value
method, you will not get the styling because it is applied to the editor div instead of to a span within the editor.A possible fix is to have another inner div within the editor, whose innerHTML we return instead of that of the editor itself.
Examples:
Note:
arte = $(".editor").Arte()
Bolding all of the text in the editor:
arte.get(0).value()
returns"Please enter text ..."
$(".editor")[0].innerHTML
is<div contenteditable="true" class="" style="height: 200px; width: 300px; overflow: auto; border: 1px dashed gray; font-weight: bold;">Please enter text ...</div>
Bolding only the word
enter
:arte.get(0).value()
returns"Please <span style="font-weight: bold;">enter</span> text ..."
$(".editor")[0].innerHTML
is<div contenteditable="true" class="" style="height: 200px; width: 300px; overflow: auto; border: 1px dashed gray;">Please <span style="font-weight: bold;">enter</span> text ...</div>
The text was updated successfully, but these errors were encountered: