Search
 
SCRIPT & CODE EXAMPLE
 

HTML

jquery download text in html element new line

 function download() {
        var a = document.body.appendChild(
            document.createElement("a")
        );
        var textToWrite = document.getElementById("show-data").innerText;
        a.download = "export.txt"; 
        textToWrite = textToWrite.replace(/
/g, "%0D%0A"); 
        a.href = "data:text/plain," + textToWrite;
        a.click();
    }
Comment

PREVIOUS NEXT
Code Example
Html :: https://api.github.com/search/issues?q=windows+label:bug+language:python+state:open&sort=created&order=asc 
Html :: 2 button component in single row vuetify 
Html :: what is indentation in web development 
Html :: vue src string concatenation 
Html :: chrome extension button click to different html page 
Html :: audio element not visible 
Html :: Hyperlink in razor 
Html :: font awesome free cdn 
Html :: Remove preceding text or numbers Google Sheets 
Html :: empty label html 
Html :: overlay text input html 
Html :: index number in odoo reports 
Html :: html regex p.iva 
Html :: read_html pandas skiprows function example 
Html :: Blade deletes the html code in the file 
Html :: howdy 
Html :: como recupperar senha html 
Html :: w3 
Html :: href="/jump/? 
Html :: javascript limit input to 2 decimal places 
Html :: repeat task multicraft 
Html :: how to create a video link in html 
Html :: bootstrap navbar 
Html :: tag list 
Html :: html games for mobile 
Css :: how to center div with transform 
Css :: how to remove scrollbar in css 
Css :: css placeholder color 
Css :: font shadow css 
Css :: new line in url 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =