当前位置:网站首页>拖放
拖放
2022-06-26 02:49:00 【小菜鸟码住】
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
#box{
width: 300px;
height: 300px;
border: 3px solid red;
}
</style>
</head>
<body>
<img id="img" src="img/musicBtn.png" alt=""/>
<div id="box">
</div>
<script>
var img = document.getElementById('img');
var box = document.getElementById('box');
img.ondragstart = function(e){
console.log(1);
e.dataTransfer.setData('text',this.id);
}
box.ondragover = function(e){
e.preventDefault();//取消默认事件处理
}
box.ondrop = function(e){
var txt = e.dataTransfer.getData('text');
// console.log(txt);
box.appendChild(document.getElementById(txt));
// img.parentNode.removeChild(img);
// box.innerHTML += '<img src="'+txt+'">';
}
</script>
</body>
</html>


边栏推荐
- Translation notes of orb-slam series papers
- 工业机器人之“慧眼”——机器视觉
- Une citation classique de la nature humaine que vous ne pouvez pas ignorer
- 国信金太阳靠谱吗?开证券账户安全吗?
- Use annotationdbi to convert gene names in R
- Utonmos: digital collections help the inheritance of Chinese culture and the development of digital technology
- UE5全局光照系統Lumen解析與優化
- Clion项目中运行多个main函数
- 【哈希表】改进,拉链法哈希结构——直接用两个索引查找,不用每次都hash和%一遍
- 学习太极创客 — MQTT(四)服务端连接操作
猜你喜欢

计组笔记 数据表示与运算 校验码部分

Dual batteries in series, hardware design

Good news | congratulations on the addition of 5 new committers in Apache linkage (incubating) community
![[flask introduction series] flask processing request and response](/img/4b/bb5d915e83341183270d492b98f7d3.png)
[flask introduction series] flask processing request and response

数字孪生智慧水务,突破海绵城市发展困境

ArrayList # sublist these four holes, you get caught accidentally

工业机器人之“慧眼”——机器视觉

Additional: brief description of hikaricp connection pool; (I didn't go deep into it, but I had a basic understanding of hikaricp connection pool)

Review of the paper: unmixing based soft color segmentation for image manipulation

计组笔记——CPU的指令流水
随机推荐
On virtual memory and oom in project development
我在中山,到哪里开户比较好?网上开户是否安全么?
在UE内添加控制台工程(Programs)
2022年挖财证券开户安全嘛?
限制输入字符长度length英文1个字符中文2个字符
培育项目式Steam教育理念下的儿童创造力
Scratch returns 400
如何筹备一场感人的婚礼
Stm32cubemx: watchdog ------ independent watchdog and window watchdog
Golang--channel and select
QT compilation error: unknown module (s) in qt: script
The role of children's programming in promoting traditional disciplines in China
计组笔记 数据表示与运算 校验码部分
MySQL数据库基础
[machinetranslation] - Calculation of Bleu value
Analysis of technological changes in social robots
Gd32 ADC acquisition voltage
关于#sql#的问题:SQL问题--账号多地登录的SQL代码
[solution] the blue screen restart problem of the virtual machine started by the VMware of Lenovo Savior
The difference between like,%, - in database query SQL