- Now we will put onchange on the input type and this will execute a function imageUploaded() when you upload an image.
- Now we will use a file reader and use the onload event in the file reader than we will get the image URL and we need to remove some text to get the base64 string and store it in a variable named base64String and print on the console.
- And if you want to use this base64 you can write logic on the button click like here we will alert this base64 String.
Example: This example shows the above-explained approach.
My Personal Notes arrow_drop_up
Please Login to comment...