We would like to know how to create a new tag in the DOM with Jsoup.
import java.io.File; /* ww w . ja v a 2 s . c om*/ import org.jsoup.Jsoup; import org.jsoup.nodes.Document; public class Main { public static void main(String[] args) throws Exception { Document doc = Jsoup.parse(new File("t2.html"), "UTF-8"); doc.select("area#area1").after("<area id=\"newArea\" />"); System.out.println(doc.html()); } }