Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the problem that the jquery element cannot be found

Shulou Source: shulou.com Published: 2022-06-02 16:26:08 09月21日 Update

This article focuses on "how to solve the problem that the jquery element can not be found". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to solve the problem that the jquery element can't be found".

Jquery element can not find the solution: 1, view the corresponding code file; 2, check the error through debug; 3, remove the point in id.

This article operating environment: windows7 system, jquery3.2.1 version, DELL G3 computer

What if the jquery element cannot be found?

Jquery cannot get the specified element using $

The specific code is as follows:

Var id='#'+screen.timeleftvar timeCountDown = $(id)

Then the timeCountDown is always empty, and the debug discovers:

The reason is that id contains "." After removing it, the element is found.

Var id='#'+screen.timeleft.replace (/\. / g, ") .replace (/\: / g,") .replace (/\-/ g, ") var timeCountDown = $(id)

And then it's normal.

At this point, I believe that everyone has a deeper understanding of "how to solve the problem of jquery element can not be found", might as well come to the actual operation! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Elements problems code content learning practical deeper interest method reason place practicality practice how to do simple operation file method more friends environment Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia vpn Linux Shulou Tech Info MariaDB