Cursor position determination method and device, equipment and storage medium

By responding to text input instructions on the web page, obtaining text information before the cursor and filling in the corresponding auxiliary elements, the problem of difficult to determine the cursor position is solved, and more efficient cursor position determination is achieved.

CN119960611APending Publication Date: 2025-05-09BEIJING JINGWEI HIRAIN TECH CO INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510019658.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

In the prior art, the cursor position is difficult to determine in a certain element of the page, resulting in low efficiency in determining the cursor position.

Method used

In response to the text input instruction, the text information before the cursor in the text input label is obtained, the information is filled in the auxiliary element adjacent to the text input label and the same style class name, and the position information of the auxiliary element is obtained as the cursor position.

Benefits of technology

The efficiency of determining the cursor position is improved, the dependence on the binding of global file object in the prior art is reduced, and the accuracy of determining the cursor position is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119960611A_ABST
    Figure CN119960611A_ABST
Patent Text Reader

Abstract

The invention provides a cursor position determination method and device, equipment and a storage medium, and the method comprises the steps: obtaining text information in front of a cursor in a text input tag in response to a text input instruction; filling the text information into an auxiliary element to obtain the filled auxiliary element; and acquiring the position information of the filled auxiliary element, and determining the position information of the filled auxiliary element as the position information of the cursor. Wherein the auxiliary element is a webpage label adjacent to the text input label in a webpage structure, and the style class name of the auxiliary element is the same as that of the text input label. According to the method, the auxiliary element adjacent to the text input label is filled with the text information, and the cursor position is determined based on the position of the auxiliary element convenient to obtain, so that the determination efficiency of the cursor position can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a cursor position determination method, device, equipment and storage medium. Background Art

[0002] The cursor, also known as the cursor, is used to indicate the position where the user is going to enter characters when the user enters characters in a text box or a program.

[0003] Currently, the coordinates of the cursor on the page can be obtained based on the mouse events provided by the browser and the interpreted scripting language (JavaScript, JS). Since mouse events can occur anywhere on the page, in actual application scenarios, in order to ensure that mouse events are effective, mouse events need to be bound to the global document object.

[0004] When the mouse event is bound to the global file object, the cursor position in a certain element of the page is difficult to determine, resulting in a problem of low efficiency in determining the cursor position. Summary of the invention

[0005] Based on the above problems, the present application provides a cursor position determination method, device, equipment and storage medium, aiming to improve the efficiency of cursor position determination.

[0006] The embodiments of the present application disclose the following technical solutions:

[0007] In the first aspect, the present application provides a method for determining a cursor position, comprising:

[0008] In response to a text input instruction, obtaining text information before a cursor in a text input tag;

[0009] Filling the text information into an auxiliary element to obtain the filled auxiliary element, wherein the auxiliary element is a web page tag adjacent to the text input tag in the web page structure, and the style class name of the auxiliary element is the same as that of the text input tag;

[0010] The position information of the filled auxiliary element is obtained, and the position information of the filled auxiliary element is determined as the position information of the cursor.

[0011] In a possible implementation manner, the attribute of the auxiliary element includes at least one of an invisible effect and an absolute positioning effect, and the absolute positioning effect is used to separate the auxiliary element from a standard document flow.

[0012] In a possible implementation, in response to the text input instruction, obtaining text information before the cursor in the text input tag includes:

[0013] In response to the text input instruction, obtaining text character information before the cursor in the text input tag;

[0014] Valid text is extracted from the text character information to obtain the text information before the cursor.

[0015] In a possible implementation, extracting valid text from the text character information to obtain the text information before the cursor includes:

[0016] Get the number of text characters to be extracted;

[0017] Extract the number of text characters to be extracted forward from the last text character in the text character information before the cursor to obtain the text information before the cursor.

[0018] In a possible implementation, the text input tag is an input tag Input, and the auxiliary element is a separator tag DIV.

[0019] In a possible implementation, filling the text information into the auxiliary element to obtain the filled auxiliary element includes:

[0020] The internal hypertext markup language innerHTML attribute is set to fill the text information into the auxiliary element to obtain the filled auxiliary element.

[0021] In a possible implementation, the acquiring the position information of the filled auxiliary element includes:

[0022] Based on the element position event getBoundingClientRect, the position information of the filled auxiliary element is obtained.

[0023] Second aspect: The present application provides a cursor position determination device, comprising:

[0024] Get unit, fill unit, and confirm unit;

[0025] The acquisition unit is used to acquire the text information before the cursor in the text input tag in response to the text input instruction;

[0026] The filling unit is used to fill the text information into the auxiliary element to obtain the filled auxiliary element, the auxiliary element is a web page tag adjacent to the text input tag in the web page structure, and the style class name of the auxiliary element is the same as that of the text input tag;

[0027] The determining unit is used to obtain the position information of the filled auxiliary element, and determine the position information of the filled auxiliary element as the position information of the cursor.

[0028] In a possible implementation manner, the attribute of the auxiliary element includes at least one of an invisible effect and an absolute positioning effect, and the absolute positioning effect is used to separate the auxiliary element from a standard document flow.

[0029] In a possible implementation, the acquiring unit includes:

[0030] Sub-acquisition unit and extraction unit;

[0031] The sub-acquisition unit is used to acquire text character information before the cursor in the text input tag in response to the text input instruction;

[0032] The extraction unit is used to extract valid text from the text character information to obtain the text information before the cursor.

[0033] In a possible implementation, the extraction unit includes:

[0034] quantity acquisition unit and sub-extraction unit;

[0035] The quantity acquisition unit is used to acquire the quantity of text characters to be extracted;

[0036] The sub-extraction unit is used to extract text characters of the number of text characters to be extracted from the last text character in the text character information before the cursor, so as to obtain the text information before the cursor.

[0037] In a possible implementation, the text input tag is an input tag Input, and the auxiliary element is a separator tag DIV.

[0038] In a possible implementation, the filling unit is specifically used to:

[0039] The internal hypertext markup language innerHTML attribute is set to fill the text information into the auxiliary element to obtain the filled auxiliary element.

[0040] In a possible implementation manner, the determining unit is specifically configured to:

[0041] Based on the element position event getBoundingClientRect, the position information of the filled auxiliary element is obtained.

[0042] A third aspect: The present application provides a computing device, the computing device comprising: a processor and a memory;

[0043] The memory is used to store program codes and transmit the program codes to the processor;

[0044] The processor is used to execute the steps of the cursor position determination method as described above according to the instructions in the program code.

[0045] Fourth aspect: The present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a cursor position determination method as described above are implemented.

[0046] Compared with the prior art, this application has the following beneficial effects:

[0047] The present application provides a method for determining the cursor position, which obtains the text information before the cursor in the text input tag in response to a text input instruction; fills the text information into an auxiliary element to obtain the filled-in auxiliary element; obtains the position information of the filled-in auxiliary element, and determines the position information of the filled-in auxiliary element as the cursor position information. The auxiliary element is a web page tag adjacent to the text input tag in the web page structure, and the auxiliary element has the same style class name as the text input tag. The present application fills the text information into the auxiliary element adjacent to the text input tag, and determines the cursor position based on the auxiliary element position that is easy to obtain, which can effectively improve the efficiency of determining the cursor position. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0049] Figure 1 A schematic diagram of a method for determining a cursor position based on mouse events;

[0050] Figure 2 A flowchart of a method for determining a cursor position provided in an embodiment of the present application;

[0051] Figure 3 A schematic diagram of determining a cursor position provided in an embodiment of the present application;

[0052] Figure 4 A schematic diagram of the structure of a cursor position determination device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0054] The cursor, also known as the cursor, is used to indicate the position where the user is going to enter characters when the user enters characters in a text box or a program.

[0055] Currently, the current position of the mouse can be obtained by detecting mouse movement events, and the cursor position can be determined based on the mouse position.

[0056] For example, in actual application scenarios, a series of mouse events provided by the browser and the interpreted scripting language (JavaScript, JS) can be used to obtain the coordinates of the mouse on the page in real time. Among them, the mouse event can be a mouse move (mousemove) event, based on which the horizontal coordinate and vertical coordinate of the mouse relative to the browser window can be obtained. After the mouse position is obtained, the cursor position can be determined based on the mouse position.

[0057] However, since mouse events can occur anywhere in a page, in actual application scenarios, to ensure that mouse events are effective, mouse events need to be bound to a global document object. In this case, the cursor position in an element of the page is difficult to determine, resulting in a low efficiency in determining the cursor position.

[0058] For example, Figure 1 As shown in the figure, this figure is a schematic diagram of a method for determining a cursor position based on mouse events. Figure 1 In the example, an input box 1101 is displayed on page 1100. When a user enters text information in the input box 1101, because the mouse event is bound to the global file object, the mouse position information obtained is based on the upper left corner 1102 of the entire page as the origin, while the cursor position that needs to be obtained is based on the upper left corner 1103 of the input box 1101 as the origin. In this case, it is difficult to determine the position of the cursor relative to the input box 1101, and there is a problem of low efficiency in determining the cursor position.

[0059] Based on this, the present application provides a method for determining the cursor position, which obtains the text information before the cursor in the text input tag in response to a text input instruction; fills the text information into an auxiliary element to obtain the filled-in auxiliary element; obtains the position information of the filled-in auxiliary element, and determines the position information of the filled-in auxiliary element as the cursor position information. Wherein, the auxiliary element is a web page tag adjacent to the text input tag in the web page structure, and the auxiliary element has the same style class name as the text input tag. The present application fills the text information into the auxiliary element adjacent to the text input tag, and determines the cursor position based on the auxiliary element position that is easy to obtain, which can effectively improve the efficiency of determining the cursor position.

[0060] Combine the following Figure 2 A method for determining a cursor position provided by the present application is introduced. Figure 2 A flowchart of a cursor position determination method provided in an embodiment of the present application.

[0061] The present application provides a cursor position determination method, which can be implemented through S101-S103.

[0062] S101 . In response to a text input instruction, obtain text information before a cursor in a text input tag.

[0063] Exemplarily, the text input tag may be an input tag. The input tag may define an input field in which a user may enter data, for example, the input field may be a text field, etc. It is understood that the embodiments of the present application do not specifically limit the text input tag, and the above input tag is only an example.

[0064] The controls for inputting text information in the browser may include, but are not limited to, text boxes and text fields. The cursor position determination method provided in the present application can be used to determine the cursor position in a text field, and can also be used to determine the cursor position in a text box. Compared with a text box, a text field supports more input content and a larger display area. Therefore, the following takes determining the cursor position in a text field as an example to introduce the cursor position determination method provided in an embodiment of the present application.

[0065] In a possible implementation, when obtaining the text information before the cursor in the text input tag in response to the text input instruction, the text character information before the cursor in the text input tag can be obtained in response to the text input instruction. On this basis, effective text extraction is performed on the text character information to obtain the text information before the cursor.

[0066] The effective text extraction from the text character information to obtain the text information before the cursor can be achieved in the following manner: that is, obtaining the number of text characters to be extracted; extracting the number of text characters to be extracted from the last text character in the text character information before the cursor to obtain the text information before the cursor.

[0067] Exemplarily, in response to a text input instruction, the number of text characters to be extracted is obtained through the selectionStart event, and on this basis, the number of text characters to be extracted can be extracted forward from the last text character in the text character information before the cursor to obtain the text information before the cursor. Among them, the selectionStart event can be used to obtain or set the character index of the starting position of the current selection.

[0068] In an embodiment of the present application, when obtaining the text information before the cursor, it is not necessary to obtain all the text character information in the text input tag. It is only necessary to extract the number of text characters to be extracted and use it as the text information before the cursor, thereby reducing redundant data and improving acquisition efficiency.

[0069] S102: Fill the text information into an auxiliary element to obtain the filled auxiliary element.

[0070] The auxiliary element is a web page tag adjacent to the text input tag in the web page structure, and the style class name of the auxiliary element is the same as that of the text input tag.

[0071] For example, in the embodiment of the present application, the text input tag can be an input tag (Input), and the auxiliary element can be a separator tag (DIV). It should be noted that the type of auxiliary elements is not specifically limited in the embodiment of the present application. The DIV tag has fewer style attributes and is a basic tag that can be compatible with various browsers. Here, only the DIV tag is used as an example for introduction.

[0072] In a possible implementation, in order to facilitate the determination of the cursor position information, a DIV tag is inserted adjacent to the text input tag, and the DIV tag can share the parent element position and style setting effect. At the same time, in order to make the text style of the text input tag and the DIV tag the same, such as the same font weight, font size, line spacing, etc., the two are set with the same class name to avoid the problem of deviation between the auxiliary element and the actual cursor position due to the different text styles of the two, thereby ensuring the accuracy of the determined cursor position.

[0073] For example, in an embodiment of the present application, a DIV tag can be inserted before the text input tag of the network structure, so that the text input tag is adjacent to the DIV tag. On this basis, the same Cascading Style Sheets (CSS) style class name is set for both, such as a text area (common-textarea) of general attributes. At the same time, in order to make the text information source received by the text input tag and the DIV tag consistent, the same variable text (text) can be bound to both.

[0074] In a possible implementation, after inserting a DIV tag adjacent to a text input tag, redundant structures may appear in the page. For example, after a piece of text information is entered, the text information will be displayed twice in the page, reducing the display effect of the page. Based on this, in an embodiment of the present application, an invisible effect can be added to the auxiliary element. For example, an inline style is added to the auxiliary element, and a visibility attribute is added to the attribute value as hidden, that is, the visibility attribute corresponding to the auxiliary element is set to hidden.

[0075] At the same time, auxiliary elements may occupy the page space occupied by text input tags. After adding invisible effects to auxiliary elements, text information is no longer displayed repeatedly on the page, but a blank space is left on the page for auxiliary elements, reducing the display effect of text input tags. To this end, an absolute positioning effect can be added to the auxiliary elements, and the absolute positioning effect is used to separate the auxiliary elements from the standard document flow. Exemplarily, an inline style is added to the auxiliary elements, and the position attribute is added to the attribute value as absolute, that is, the position attribute corresponding to the auxiliary element is set to absolute, so that the auxiliary element is separated from the standard document flow.

[0076] It should be noted that in the embodiment of the present application, the auxiliary element can be added with an invisible effect or an absolute positioning effect, and the auxiliary element can also be added with an invisible effect and an absolute positioning effect at the same time. In the embodiment of the present application, by setting an invisible effect and an absolute positioning effect for the auxiliary element, the auxiliary element can be prevented from causing a visible impact on the page, and there is no need to modify the attributes of the text input tag.

[0077] In the embodiment of the present application, when inputting text information in the text input tag, the cursor in the text field element will keep changing accordingly. Since the text information needs to be filled into the auxiliary element, in order to reduce the influence of the auxiliary element on the text information, or to avoid the influence of the auxiliary element on the text information, the width and height of the auxiliary element can be set before the text information is filled into the auxiliary element, so that the width and height of the auxiliary element correspond to the width and height of the text information in the text input tag.

[0078] In a possible implementation, the text information may be filled into the auxiliary element by setting the innerHTML attribute of the internal hypertext markup language to obtain the filled auxiliary element.

[0079] Since auxiliary elements have an invisible effect on the page, they will not affect the text information. On this basis, the position of the auxiliary element will completely overlap with the text information before the cursor in the text field element. Figure 3 As shown, this figure is a schematic diagram of cursor position determination provided in an embodiment of the present application.

[0080] In the figure, the dotted line indicates that the auxiliary element 1302 has an invisible effect, and the text information in the text input label is "currently inputting text information". After the text field 1301 with the text input label is merged with the filled auxiliary element 1302, the right side 1303 of the auxiliary element will overlap with the cursor. Since the auxiliary element has an invisible effect, the text field still only displays the text information in the text input label.

[0081] S103: Acquire the position information of the filled auxiliary element, and determine the position information of the filled auxiliary element as the position information of the cursor.

[0082] Exemplarily, in an embodiment of the present application, the position information of the filled auxiliary element can be obtained based on the element position event (getBoundingClientRect).

[0083] Among them, getBoundingClientRect is a function used to obtain the bounding box of an element, which can return an object containing the coordinates of the upper left corner, width, and height of the element.

[0084] In summary, the present application provides a method for determining the cursor position, which obtains the text information before the cursor in the text input tag by responding to a text input instruction; fills the text information into an auxiliary element to obtain the filled-in auxiliary element; obtains the position information of the filled-in auxiliary element, and determines the position information of the filled-in auxiliary element as the cursor position information. The auxiliary element is a web page tag adjacent to the text input tag in the web page structure, and the auxiliary element has the same style class name as the text input tag. The present application fills the text information into the auxiliary element adjacent to the text input tag, and determines the cursor position based on the auxiliary element position that is easy to obtain, which can effectively improve the efficiency of determining the cursor position.

[0085] At the same time, the method provided in the embodiment of the present application is easy to operate, does not rely on any framework, can be implemented based on the native framework, is not affected by browser compatibility, and is conducive to improving development efficiency and optimizing display effects.

[0086] For ease of understanding, the following takes the text input tag as the input tag and the auxiliary element as the DIV tag as an example to provide an overall introduction to the cursor position determination method provided in the present application.

[0087] In the embodiment of the present application, a DIV tag is added as an auxiliary element before the input tag of the web page structure. The input tag and the DIV tag are adjacent to each other and have the same CSS style class name. At the same time, the text information received by the input element and the DIV tag is ensured to be consistent in source, and the same variable text is bound to both.

[0088] After adding a DIV tag before the input tag in the web page structure, add an inline style to the DIV tag, add the visibility attribute to hidden in its attribute value, and add the position attribute to absolute. Do not change the input tag.

[0089] After completing the setting of the DIV tag, only the input tag will be displayed on the page. When entering text information in the input tag, the position of the cursor in the text field element will change accordingly. To determine the position of the cursor, in an embodiment of the present application, the text character information before the cursor in the input tag can be first obtained, and the number of text characters to be extracted can be obtained through the selectionStart event. Then, based on the number of text characters to be extracted, valid text can be extracted from the text character information to obtain the text information before the cursor.

[0090] By setting innerHTML, the obtained text information before the cursor is filled into the DIV tag to obtain the filled DIV tag. On this basis, the position information of the DIV tag can be obtained through the event getBoundingClientRect(), and the position information of the DIV tag can be used to replace the position information of the cursor.

[0091] Exemplarily, the position information of the DIV tag may include the position data of the DIV tag relative to the text area, up, down, left, and right.

[0092] In summary, the present application fills the text information into the auxiliary element adjacent to the text input tag, and determines the cursor position based on the auxiliary element position that is easy to obtain, which can effectively improve the efficiency of determining the cursor position. At the same time, based on the method provided in the embodiment of the present application, the Document Object Model (DOM) operation can be reduced, it is easy to operate, based on the native framework, it can be implemented without relying on other frameworks, and is not affected by browser compatibility, which is conducive to improving development efficiency and optimizing display effects.

[0093] The present application provides a cursor position determination device, and its specific implementation method is consistent with the implementation method and the technical effect achieved in the above-mentioned embodiment, and some contents will not be repeated here.

[0094] The present application provides a cursor position determination device, such as Figure 4 As shown in the figure, this figure is a structural schematic diagram of a cursor position determination device provided in an embodiment of the present application.

[0095] The cursor position determination device comprises: an acquisition unit 1201, a filling unit 1202, and a determination unit 1203;

[0096] The acquisition unit 1201 is used to acquire text information before a cursor in a text input tag in response to a text input instruction;

[0097] The filling unit 1202 is used to fill the text information into the auxiliary element to obtain the filled auxiliary element, the auxiliary element is a web page tag adjacent to the text input tag in the web page structure, and the style class name of the auxiliary element is the same as that of the text input tag;

[0098] The determining unit 1203 is used to obtain the position information of the filled auxiliary element, and determine the position information of the filled auxiliary element as the position information of the cursor.

[0099] In a possible implementation manner, the attribute of the auxiliary element includes at least one of an invisible effect and an absolute positioning effect, and the absolute positioning effect is used to separate the auxiliary element from a standard document flow.

[0100] In a possible implementation, the acquiring unit includes:

[0101] Sub-acquisition unit and extraction unit;

[0102] The sub-acquisition unit is used to acquire text character information before the cursor in the text input tag in response to the text input instruction;

[0103] The extraction unit is used to extract valid text from the text character information to obtain the text information before the cursor.

[0104] In a possible implementation, the extracting unit includes:

[0105] quantity acquisition unit and sub-extraction unit;

[0106] The quantity acquisition unit is used to acquire the quantity of text characters to be extracted;

[0107] The sub-extraction unit is used to extract text characters of the number of text characters to be extracted from the last text character in the text character information before the cursor, so as to obtain the text information before the cursor.

[0108] In a possible implementation, the text input tag is an input tag Input, and the auxiliary element is a separator tag DIV.

[0109] In a possible implementation, the filling unit is specifically used to:

[0110] The internal hypertext markup language innerHTML attribute is set to fill the text information into the auxiliary element to obtain the filled auxiliary element.

[0111] In a possible implementation manner, the determining unit is specifically configured to:

[0112] Based on the element position event getBoundingClientRect, the position information of the filled auxiliary element is obtained.

[0113] In summary, the present application provides a device for determining the cursor position, which obtains the text information before the cursor in the text input tag by responding to a text input instruction; fills the text information into an auxiliary element to obtain the filled-in auxiliary element; obtains the position information of the filled-in auxiliary element, and determines the position information of the filled-in auxiliary element as the cursor position information. The auxiliary element is a web page tag adjacent to the text input tag in the web page structure, and the auxiliary element has the same style class name as the text input tag. The present application fills the text information into the auxiliary element adjacent to the text input tag, and determines the cursor position based on the auxiliary element position that is easy to obtain, which can effectively improve the efficiency of determining the cursor position.

[0114] The embodiment of the present application further provides a computing device, the computing device comprising: a processor and a memory;

[0115] The memory is used to store program codes and transmit the program codes to the processor;

[0116] The processor is used to execute the steps of the cursor position determination method as described above according to the instructions in the program code.

[0117] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the cursor position determination method described above are implemented.

[0118] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components indicated as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0119] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for determining a cursor position, characterized in that: include: In response to a text input instruction, obtaining text information before a cursor in a text input tag; Filling the text information into an auxiliary element to obtain the filled auxiliary element, wherein the auxiliary element is a web page tag adjacent to the text input tag in the web page structure, and the style class name of the auxiliary element is the same as that of the text input tag; The position information of the filled auxiliary element is obtained, and the position information of the filled auxiliary element is determined as the position information of the cursor.

2. The method according to claim 1, characterized in that The attributes of the auxiliary element include at least one of an invisible effect and an absolute positioning effect, and the absolute positioning effect is used to separate the auxiliary element from a standard document flow.

3. The method according to claim 1, characterized in that The step of obtaining text information before a cursor in a text input tag in response to a text input instruction includes: In response to the text input instruction, obtaining text character information before the cursor in the text input tag; Valid text is extracted from the text character information to obtain the text information before the cursor.

4. The method according to claim 3, characterized in that The step of extracting effective text from the text character information to obtain the text information before the cursor includes: Get the number of text characters to be extracted; Extract the number of text characters to be extracted forward from the last text character in the text character information before the cursor to obtain the text information before the cursor.

5. The method according to claim 1, characterized in that The text input tag is an input tag Input, and the auxiliary element is a separator tag DIV.

6. The method according to claim 5, characterized in that Filling the text information into the auxiliary element to obtain the filled auxiliary element includes: The internal hypertext markup language innerHTML attribute is set to fill the text information into the auxiliary element to obtain the filled auxiliary element.

7. The method according to claim 5, characterized in that The obtaining the position information of the filled auxiliary element includes: Based on the element position event getBoundingClientRect, the position information of the filled auxiliary element is obtained.

8. A cursor position determination device, characterized in that: include: Get unit, fill unit, and confirm unit; The acquisition unit is used to acquire the text information before the cursor in the text input tag in response to the text input instruction; The filling unit is used to fill the text information into the auxiliary element to obtain the filled auxiliary element, the auxiliary element is a web page tag adjacent to the text input tag in the web page structure, and the style class name of the auxiliary element is the same as that of the text input tag; The determining unit is used to obtain the position information of the filled auxiliary element, and determine the position information of the filled auxiliary element as the position information of the cursor.

9. A computing device, characterized in that The computing device includes: a processor and a memory; The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the steps of a cursor position determination method as described in any one of claims 1-8 according to the instructions in the program code.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a cursor position determination method according to any one of claims 1 to 8 are implemented.