The XML namespaces will be specified in the header section. This source HTML will be encoded and appended with the data URI that is linked with a download element created dynamically.
<div id="source-html"> <h1> <center>Artificial Intelligence</center> </h1> <h2>Overview</h2> <p> Artificial Intelligence(AI) is an emerging technology demonstrating machine intelligence. The sub studies like <u><i>Neural Networks</i>, <i>Robatics</i> or <i>Machine Learning</i></u> are the parts of AI. This technology is expected to be a prime part of the real world in all levels. </p> </div> <div class="content-footer"> <button id="btn-export" onclick="exportHTML();">Export to word doc</button> </div>
With these specifications, the source HTML will be encoded to form the URI. Then, a download link element will be created dynamically and the URI is hyperlinked with this element. Then, the click event is triggered programmatically to download the word document with the exported HTML data.