Will using js to hide dom elements be judged by search engines as SEO cheating?

makes a single-page web application. In order to be crawled by search engine crawlers, the following methods are used:

  1. put the content that needs to be crawled in the page html file, which is just for search engine crawlers to see
  2. used after loading the page, js hides the content nodes so that the user cannot see them, so it does not affect the display of the user interface
The code of the

program is roughly as follows:

<html>

<div>
  

UI

</div> <div id="content">

</div> <script> ; idcontentdiv; </script> </html>

some data show that if you use display:none to modify the div, with id as content, the search engine will determine that the content is illegally hidden, resulting in the page not being included, or ignoring the text of display:none.

will the use of js to hide div, be judged by search engines as SEO cheating?

Apr.05,2021

No need to hide, set the information you want to be caught to text-indent:-9999px, and process it so that he can't click on it. For example, the id above is the div of content

.
-sharpid{
    width: 1px;
    height: 1px;
    float: left;
    text-indent:-9999px;
}
Menu