空格
nbsp;
长传图片在上面实时显示
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>图片预览示例</title>
<style>
.image-preview {
max-width: 100%;
max-height: 300px;
}
</style>
</head>
<body>
<input type="file" id="input-image" accept="image/*">
<img id="image-preview" class="image-preview" src="#" alt="预览图片" style="display:none;">
<script>
document.getElementById('input-image').addEventListener('change', function (event) {
var file = event.target.files[0];
var reader = new FileReader();
reader.onload = function (e) {
var imagePreview = document.getElementById('image-preview');
imagePreview.src = e.target.result;
imagePreview.style.display = 'block';
};
if (file) {
reader.readAsDataURL(file);
} else {
document.getElementById('image-preview').style.display = 'none';
}
});
</script>
</body>
</html>
表格序号自增
//tr开始主动加一
$(function(){
//$('table tr:not(:first)').remove();
var len = $('table tr').length;
for(var i = 1;i<len;i++){
$('table tr:eq('+i+') td:first').text(i);
}
});
标签:常用,标签,image,tr,HTML,file,var,imagePreview,preview
From: https://www.cnblogs.com/zxc3360655/p/17255580.html