Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

download text file javascript

const downloadTxtFile = () => {
    const element = document.createElement("a");
    const file = new Blob([text], {
      type: "text/plain",
    });
    element.href = URL.createObjectURL(file);
    element.download = "myFile.txt";
    document.body.appendChild(element);
    element.click();
  };
Comment

PREVIOUS NEXT
Code Example
Javascript :: drupal 8 get url from node entity 
Javascript :: jquery index of element 
Javascript :: remove empty element from array js 
Javascript :: react select with react hook form cotroller 
Javascript :: javascript count occurrences in string 
Javascript :: array of refs react 
Javascript :: inline if else javascript 
Javascript :: zoom in canvas javascript 
Javascript :: read all file names of folder in react 
Javascript :: angular right click 
Javascript :: nextjs localstorage 
Javascript :: jquery form validation plugin callback function 
Javascript :: check the string is vowel or not javascript 
Javascript :: js invert color 
Javascript :: Facebook passport Oauth authenticate strategy 
Javascript :: mysql connection in node js 
Javascript :: how to create a folder in node js 
Javascript :: to capital case javascript 
Javascript :: nestjs change httpcode inside function 
Javascript :: assign this value or if it is undefined this other value javascript 
Javascript :: make contenteditable false javascript 
Javascript :: add item to list javascript 
Javascript :: limit characters display javascript 
Javascript :: moment js react 
Javascript :: jspdf attach image file 
Javascript :: get nth character of string javascript 
Javascript :: javascript add to array 
Javascript :: how to use react router 
Javascript :: how to create a random number generator in javascript 
Javascript :: read and update csv file in nodejs 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =