Read about how to make text editor in javascript, The latest news, videos, and discussion topics about how to make text editor in javascript from alibabacloud.com
javascript| Printing
Before I post, I hope members can give me valuable comments and suggestions, if there is a wrong place, give a point of view; and I want to thank the Flash bar,Action The script discussion area's moderator as well as the Supertomato. Because there are many unknown people to provide free help, I make a little contribution in the time, I hope to bring you a little harvest. Thank you!
I r
as TD for a Object Array . getattribute (): Gets the property value based on the given property nameSuch as:title= "name">Jackie is happyp >Name can be obtained by document.getElementsByTagName ("P") [0].getattribute ("title").Note: This method cannot be called through the document and can only be called through an element node object. SetAttribute (): Sets the value of a property.If you pass document.getElementsByTagName ("P") [0].setattribute ("title", "Hobby"), the property value of titl
Firefox/chrome/opera has supported this feature from a version, but the IE series is not supported by IE9, so JavaScript is required to be compatible with browsers that do not support placeholder features.
Popular Practice
The common practice now is to change the value by using the Onfocus/onblur event of the form element, as follows:
Copy Code code as follows:
Most of jquery's Watermark Plug-ins (Http://archive.plugins.jquer
is equal to the maximum value. Therefore, the sub variable I defined above plays a role.
Because the sub variable is processed only after waiting, no matter how many times it loops, it must wait until a certain amount of time + = 1. It is no longer appropriate to use it as the subscript for output.
The setTimeout function also understands that if two setTimeout time parameters are the same, these two codes will be executed at the same time, even if your code is not written in the same line. The
Html text using javascript is not optional
How can I use JavaScript to make the text in html not optional? The first method is to use the css selector as follows:
-webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-
have any additional needs, please make your own changes, of course, there are better ways to share (*^__^*)
Over
ps:01.18 updated some of KeyCode's judgments and wrongly wrote the 110 as 109 ≡(▔﹏▔)≡
Also note: For the use of the right menu or the menu bar to paste in the need for additional processing;
There is also an extreme situation where you select text in a Web page and drag it into a
Javascript| Web page
In the Web page often people use swish to do text output typing effect, in fact, JavaScript can make that effect, as shown in the following ways to add JavaScript code in the HTML file.
The first step: Add the following code to the
After the placeholder of the text input box is elegantly implemented by Javascript in the previous article, it tries to find other better ways to implement this placeholder.
The placeholder effect we want to achieve is:
When the keyboard drops, the placeholder is cleared,
If the value is empty when the keyboard is lifted, the placeholder is restored.
There are various implementation methods
The first two talk I told you how to make the characters move, so today we will see how to achieve The imitation of "kingdoms Cao Chuan" character situation dialogue. The specific links I write are below.
First, the preface
As you can remember, some of the news will be a bit of a terrible thing to do in a typewriter-like way to get the text out. So the main purpose of today is to do this.
Just on Septemb
True: Completely copying a node. What is "complete" means copying everything, including its subnodes, so that all the text nodes and all others are cloned.False: only the current node is cloned. No child node is cloned. Of course, the wrapped text is not cloned because any text has a node (text node) pointing to it)Of
Learning from scratch _ JavaScript _ series (8) -- js series (2) (event trigger sequence, text reading, js compiling ajax, input validation, and down menu)
(20) event trigger sequence
If there are multiple scripts in the document (for example, automatically executed scripts), they are executed in a certain order (in the HTML document ):
① Execute first
The output is green, and the background color turns gr
use alert to create the variable I in every loop, it is a value at any time and is equal to the maximum value. Therefore, the sub variable I defined above plays a role.
Because the sub variable is processed only after waiting, no matter how many times it loops, it must wait until a certain amount of time + = 1. It is no longer appropriate to use it as the subscript for output.
The setTimeout function also understands that if two setTimeout time parameters are the same, these two codes will be e
. Therefore, the sub variable I defined above plays a role.
Because the sub variable is processed only after waiting, no matter how many times it loops, it must wait until a certain amount of time + = 1. It is no longer appropriate to use it as the subscript for output.
The setTimeout function also understands that if two setTimeout time parameters are the same, these two codes will be executed at the same time, even if your code is not written in the same line. Therefore, if we add 100 for each
This article describes how JavaScript sorts tables or elements by text, numbers, or dates. Share to everyone for your reference. The implementation method is as follows:
Sorting table columns correctly by text, number or date. There are other//versions, plugins, etc., for this but they the either are restricted to specific//date formats, or requ IRE EVERY r
I don't know how to describe a Javascript text modifier. I like it, so that a group of texts can be switched over from left to right, but it can also make people feel that there is a dynamic change effect. If you are interested, just copy it to your webpage and you will be able to use it.
[Ctrl + A select all Note: If you need to introduce external Js, You need
1.onkeypressonkeydown differencesThe onkeypress event occurs when the user presses and releases any alphanumeric keys. However, the system buttons (for example: arrow keys, function keys) cannot be identified.The onkeydown event occurs when the user presses any keyboard key, including the system button. The captured keycode do not differentiate between letter sizes, but onkeypress.IE6 's onkeypress will accept the "carriage return event", and OnKeyDown will not acceptIE8 's onkeypress will not a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.