Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- svg,img{
- border: 3px dashed black;
- }
- textarea{
- width:50%;
- height:300px;
- }
- </style>
- <svg id="placeholder"xmlns="http://www.w3.org/2000/svg"width="135"height="13"><text x="0"y="10"font-family="Verdana"font-size="12" fill ="#acacac">Some Text</text></svg>
- <br>
- <img id="img">
- <br>
- <textarea id="result"></textarea>
- <script>
- var text = placeholder.outerHTML;
- var url = "data:image/svg+xml;,"+text.replace(/id="placeholder"/g," ").replace(/\n|([ ] )/g,"");//.replace(/" /g,"\"");
- img.src = url;
- result.value = url;
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement