Word.run(function (context) {
var currElement = context.document.getSelection();
currElement.insertHtml('<div id="xyz">abc</div>', "After");
const body = context.document.body;
const bodyHtml = body.getHtml();
context.sync().then(() => {console.log(bodyHtml.value)});}
While printing out the html of the document after calling context.sync(), it doesn't display div at all. It displays <p class=MsoNormal>abc</p> instead.
However, the text is displayed with a paragraph tag. How do you display the div tag with the id/class name when you print the html of the document?