How JS implements the specified text content in the selected specified HTML element object
This article mainly explains how JS implements the specified text content in the selected HTML element object. Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how JS implements the specified text content in the selected specified HTML element object.
The main functions are as follows:
/ / check the specified part of the text function selectSomeText (obj,start,end) {if (document.selection) {if (obj.tagName=='TEXTAREA') {var i=obj.value.indexOf ("\ r", 0); while