Create a variable in jquery with html content

前端 未结 5 1024
死守一世寂寞
死守一世寂寞 2021-02-09 13:18

Hi I am trying to create a variable in jquery that contains a table for outputting in different areas of a website. But it is giving me an error, and I do not understand why. He

5条回答
  •  情歌与酒
    2021-02-09 14:03

    When I have complex html this is what I do. I put the html in an enclosing DIV and get the html content

    var copy = $('#mycomplexhtml').html(); //gets the content I placed in an hidden div
    
    
    
    
    

提交回复
热议问题