How to convert the html string returned by the background into an operable jquery object

problem description

The

backend returns the complete html page as a string for the front end to print. I want to modify some of the styles before printing. Could you tell me how to modify it with jquery?

the environmental background of the problems and what methods you have tried

use the full page string returned by $(str), str for the background

related codes

$(str). Find (".print _ paper:first"). Css ("height", "45px");

Mar.30,2021

insert that html into div first, and then use jq to operate


this has nothing to do with jquery , does it?

if you return a page like this

 

my thoughts

  1. use string processing to force the parent node of the html string to replace the previous style= "dispaly:none"
  2. output the modified html to the page, where the html is not visible, but can be manipulated by jquery
  3. use jquery as much as you want
  4. set the parent node style of that html to visible "display:block"
Menu