nclick=“Show()“ 获取 data-id

添加链接描述

nclick=“Show()” 获取 data-id

<div class="delect_order"  onclick="Show(this)" id="delect_s"  data-id="{$vo.order_id}">删除订单</div>

<script>
    function Show(e){
    var name=e.getAttribute("data-id");
    console.log(name);
}
</script>

追加input值

 <input type="text" class="data_name" value="{$peisongfei}">
  $('.data_name').attr('value',f1);
这段代码看看有没有问题{% load static i18n %} <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <!-- plugin css --> <link href="{% static 'zadmin/libs/dropzone/min/dropzone.min.css' %}" rel="stylesheet" type="text/css"/> <title>Title</title> </head> <body> <form class="dropzone" action="{% url 'zadmin:filetext' %}" method="post" id="my-awesome-dropzone" enctype="multipart/form-data"> {% csrf_token %} {{ form.as_p }} <button type="submit" id="upload-btn">上传</button> {#<input type="file" name="file" />#} </form> <!-- Plugins js--> <script src="{% static 'zadmin/libs/dropzone/min/dropzone.min.js' %}"></script> <script type="text/javascript"> Dropzone.options.myDropzone = { // Prevents Dropzone from uploading dropped files immediately autoProcessQueue : false, paramName: "file", url: "{% url 'zadmin:filetext' %}", addRemoveLinks: true, maxFiles: 10, maxFilesize: 20, acceptedFiles: ".jpg,.gif,.png", previewsContainer: "#adds", parallelUploads: 3, dictMaxFilesExceeded: "您最多只能上传10个文件!", dictResponseError: '文件上传失败!', dictInvalidFileType: "你不能上传该类型文件,文件类型只能是*.jpg,*.gif,*.png。", init : function() { const submitButton = document.querySelector("#upload-btn"); myDropzone = this; submitButton.addEventListener("click", function() { myDropzone.processQueue(); // Tell Dropzone to process all queued files. }); // You might want to show the submit button only when // files are dropped here: this.on("addedfile", function(file, response) { // 显示提交按钮在这里和/或通知用户点击它。 }); this.on("success", function (file, response) { // 处理文件上传成功的回调 console.log("文件上传成功!"); }); this.on("error", function (file, response) { // 处理文件上传失败的回调 console.log("文件上传失败!"); }); } }; </script> </body> </html>
最新发布
07-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值