当前位置:网站首页>Input displays the currently selected picture
Input displays the currently selected picture
2022-07-04 05:37:00 【A bowl of noodles from the landlady】
1.jsp Code
<div class="lf salebd">
<a href="#">
<img src="images/ad20.jpg" id="img" width="100" height="100"/></a></div>2.js Code
$(function () {
$("#file").change(function () {
if (this.files.length) {
let file = this.files[0];
let reader = new FileReader();
// newly build FileReader object
reader.onload = function () {
// When FileReader When reading a file , The read results will be placed in FileReader.result Properties of the
document.querySelector('#img').src = this.result;
document.querySelector('#text').innerHTML = this.result;
};
// Set how to read files , Here we use base64 The way
reader.readAsDataURL(file);
}
})
})3. effect

边栏推荐
- Unity is connected to the weather system
- 2022G2电站锅炉司炉特种作业证考试题库及答案
- VB. Net simple processing pictures, black and white (class library - 7)
- Topological sorting and graphical display of critical path
- Simulink与Arduino串口通信
- VB.net 调用FFmpeg简单处理视频(类库——6)
- Notepad++ -- display related configurations
- Ping port artifact psping
- Zzulioj:1201: mode problem
- Write a complete answer applet (including single choice questions, judgment questions and multiple topics) (III) single choice questions, judgment questions, and the first question display
猜你喜欢

Ping port artifact psping

LM小型可编程控制器软件(基于CoDeSys)笔记二十一:错误3703

724. Find the central subscript of the array
![[Excel] 数据透视图](/img/45/be87e4428a1d8ef66ef34a63d12fd4.png)
[Excel] 数据透视图

ETCD数据库源码分析——初始化总览

谷歌 Chrome 浏览器将支持选取文字翻译功能

Character types of C language

Canoe panel learning video

Introduction to AMBA

VB. Net GIF (making and disassembling - optimizing code, class library - 5)
随机推荐
Li Kou's 300th weekly match
June 2022 summary
Unity2d -- character moves and turns
1480. Dynamic sum of one-dimensional array
Thinkphp6.0 middleware with limited access frequency think throttle
Principle and practice of common defects in RSA encryption application
What is MQ?
19. Framebuffer application programming
With the advent of the IP era, how can E-sports hotels take advantage of the "east wind" of games?
[matlab] matlab simulation modulation system FM system
RSA加密应用常见缺陷的原理与实践
FreeRTOS 中 RISC-V-Qemu-virt_GCC 的 锁机制 分析
VB.net GIF(制作、拆解——优化代码,类库——5)
1.1 history of Statistics
BUU-Pwn-test_ your_ nc
Etcd database source code analysis - initialization overview
BUU-Crypto-[HDCTF2019]basic rsa
LM small programmable controller software (based on CoDeSys) note XXI: error 3703
[high concurrency, high performance and high availability of massive data MySQL practice-7] - memory data drop disk
数据标注是一块肥肉,盯上这块肉的不止中国丨曼孚科技