Here is a <div>
which functions as a markdown to html converter, the inner html
of which is variable:
<div id="markdown" class="classname">
</div>
I want to make a javascript function which copies (to the clipboard) the inner html
of the <div>
, together with a stylesheet for the div
: (note: the stylesheet is not variable)
<style>
html {
font-size: 13px;
line-height: 1.5;
padding:60px;
}
<!-- and many more... -->
</style>
The expected copied result is as follows;
<style>
html {
font-size: 13px;
line-height: 1.5;
padding:60px;
}
<!-- and many more... -->
</style>
<!-- below are sample contents from the <div> -->
<h1>markdown test</h1>
<p>hello</p>
What script is needed to achieve this? Copying the result through window prompt
alert is also fine.