가까운 버튼을 클릭하면 어떻게 이미지 파일을 볼 수 있습니까? 여기서 입력 유형 파일은 동적으로 생성됩니다.버튼 클릭시 이미지를 보는 방법?
보기,
$(document).on("click", "#idImgView", function() {
var idProjectTitle = document.getElementsByClassName("idProjectTitle");
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="projectidAppe" class="form-group">
<label>Project Photos</label>
<div class="form-group file-uploader">
<div class="input-group col-xs-12">
<span class="input-group-addon"></span>
<input type="text" id="txtProjectTitle-0" style="height: 35px !important" class="form-control input-lg" disabled="" placeholder="download.jpg">
<div id="clearbtn-0" class="input-group-btn">
<div class="browse btn btn-primary" style="display: none;">
Browse
<input type="file" accept="image/*" class="idProjectTitle file" name="fileUploadphoto-0">
</div>
<div id="idImgDelete" class="browse btn btn-primary">Delete</div>
<div id="idImgView" class="browse btn btn-primary">View</div>
</div>
</div>
</div>
<div class="form-group file-uploader">
<div class="input-group col-xs-12">
<span class="input-group-addon"></span>
<input type="text" id="txtProjectTitle-1" style="height: 35px !important" class="form-control input-lg" disabled="" placeholder="Lotus_flower.jpg~c200.jpg">
<div id="clearbtn-1" class="input-group-btn">
<div class="browse btn btn-primary" style="display: none;"> Browse<input type="file" accept="image/*" class="idProjectTitle file" multiple="multiple" name="fileUploadphoto-1"></div>
<div id="idImgDelete" class="browse btn btn-primary">Delete</div>
<div id="idImgView" class="browse btn btn-primary">View</div>
</div>
</div>
</div>
</div>
이 document.getElementsByClassName
을 사용하여 수 있습니까? 어떻게 할 수 있니?
__Identifiers 당신의 HTML은 파일 업로드의 목록처럼, 파일 업로드 동적 하나를 만드는 여기 무효 – Satpal
입니다 unique__해야합니다. – AbhiJA