Hi,
In an editable div, I inserted a big letter, Rng.pasteHTML(" <font size=5>A</font>");,fine. However, after that, when type in other letters, (sometimes) I got big letters with size=5.
Here is the code:
Please let me know If anything wrong in the code.
What I tested by this code is:
Type ABC, click the button, the big A appears, press Return, put the cursor immediately after the big A, then type a letter and this letter is a big letter!
Any helps would be appreciated.
In an editable div, I inserted a big letter, Rng.pasteHTML(" <font size=5>A</font>");,fine. However, after that, when type in other letters, (sometimes) I got big letters with size=5.
Here is the code:
Code:
<html> <script> function Test() { document.getElementById("testDiv").focus() var Rng = document.selection.createRange(); Rng.pasteHTML("<font size=5>A</font>"); } </script> <body> <div id="testDiv" contentEditable="true"></div> <input type="button" onclick="Test()"> </body> </html>
What I tested by this code is:
Type ABC, click the button, the big A appears, press Return, put the cursor immediately after the big A, then type a letter and this letter is a big letter!
Any helps would be appreciated.
Comment