How to replace words with span tag using jsoup?

前端 未结 3 1705
耶瑟儿~
耶瑟儿~ 2020-12-10 07:07

Assume I have the following html:





    
I am
3条回答
  •  一生所求
    2020-12-10 07:26

    I am replacing word hello with hello(span tag)

    Document doc = Jsoup.parse(content);
        Element test =  doc.body();
        Elements elemenets = test.getAllElements();
        for(int i =0 ;i hello"));
        }
    

提交回复
热议问题