This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="programming-languages"> | |
<label for="tags">Tags:</label> | |
<select id="tags" name="tags"> | |
<option>#uncategorized</option> | |
<option>#ada</option> | |
<option>#assembly</option> | |
<option>#angular</option> | |
<option>#bash</option> | |
<option>#awk</option> | |
<option>#c</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS | |
let img = document.getElementById('img'); | |
let input = document.getElementById('input'); | |
input.onchange = (e) => { | |
if (input.files [0]) { | |
img.src = URL.createObjectURL(input.files[0]); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const textarea = document.getElementById('example-element'); // Replace example-element with the ID of your HTML textarea element. | |
textarea.addEventListener('input', function() { | |
this.style.height = 'auto'; | |
this.style.height = this.scrollHeight + 'px'; | |
}); |