I\'m trying to simulate a click on an input tag, through the click on an anchor tag, this way I can hide the input and wrap an image inside the anchor tag.
anchor
document.getElementById('user_avatar').click() will work
document.getElementById('user_avatar').click()
let fake = document.querySelector('.fake'); fake.addEventListener('click', function(e) { e.preventDefault(); document.getElementById('user_avatar').click() })
#user_avatar { display: none; }