<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Image Compressor Tool</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h1>Image Compressor Tool</h1>
<input type="file" id="fileInput" accept="image/*">
<button id="compressBtn">Compress Image</button>
<img id="previewImage" src="#" alt="Preview">
<a id="downloadLink" href="#" download="compressed_image.jpg" style="display: none;">Download Compressed Image</a>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/compressorjs/1.0.5/compressor.min.js"></script>
<script src="script.js"></script>
</body>
</html>
Documentation
Step 1:- Open txt file from the folder for code
Step 2:- Copy all code
Step 3:- Open your website dashboard or blog
Step 4:- Add HTML element
Step 5:- Paste all code in your html element
Step 6:- Save file
Done you are successfully Pasted code in
your website.