Posts

react open file browser on click a div

 import React from 'react'; const Content = () => {   const handleClick = (e) => {     const fileInput = document.getElementById('file');     fileInput.click();   };   const handleFileSelect = (e) => {     const selectedFile = e.target.files[0];     console.log(selectedFile);   };   return (     <div className="body-content">       <div className="add-media" onClick={handleClick}>         <i className="plus icon"></i>         <input type="file" id="file" style={{ display: 'none' }} onChange={handleFileSelect} />       </div>     </div>   ); }; export default Content; In this example, we use two separate functions to handle the click event on the add-media div and the selection of a file using the file input. The handleClick function is called when the user clicks the add-media div with the icon. This function retrieves the file input element using the getEleme

javascript merge two array remove duplicate values

Solution: There are two different method  first method: var array1 = ["a", "b"] var array2 = ["b", "c"] array1 = array1.concat(array2); console.log(array1);    \\ output: ["a", "b", "c"] second method : let array1 = ["a", "b"]; let array2 = ["b", "c"]; let array3 = [...array1,...array2]  \\ output:[ "a", "b", "b",  "c" ] let array4=[...new Set(array3)]  \\ hint: using the new Set method removes duplicate values ​​from  array console.log(array4); \\ output:  ["a", "b", "c"]

icon hover effect in website

Image
 icon hover effect code You can download code: First you copy Below link and then google in  search , and now you can download because this site in not directly code provided some rules blogger 🙏 https://docs.google.com/document/d/1ZjDTJD_wPzTVxTIdjpXvA7vUhdp4smc-n9IVdG9qk-8/edit?usp=sharing

wonderful circle pattern using python

Image
Amazing circles pattern using python First you copy Below link and then google in search , and now you can download because this site in not directly code provided some rules blogger 🙏 https://docs.google.com/document/d/1S3_y4GhrgL1G2ereLtncMNoZKDqHJlxtV0Jp3tIIotE/edit?usp=drivesdk

youtube logo pattern using python

YouTube logo  First you copy Below link and then google in search , and now you can download because this site in not directly code provided some rules blogger 🙏 https://docs.google.com/document/d/1Wrq72SlnfvraqfHuHKPa9rv9SCAEvwkx4gQuvZjyUyM/edit?usp=drivesdk

new amazing pattern using python

Image
New pattern using python  First you copy Below link and then google in search , and now you can download because this site in not directly code provided some rules blogger 🙏 https://docs.google.com/document/d/1RA_5alw5F8Ob7htvcllw-y8XeCQLLkPnmyRITmP5AuM/edit?usp=drivesdk

wonderful pattern using turtle python

Image
Wonderful circles pattern using python First you copy Below link and then google in search , and now you can download because this site in not directly code provided some rules blogger 🙏 https://docs.google.com/document/d/1aC0VlvkOodWtL9XfQGFkzgGy1kBfA-uNJsbGmD7s1OU/edit?usp=drivesdk