当前位置:网站首页>Drag and drop
Drag and drop
2022-06-26 03:22:00 【Small vegetable bird yard live】
<!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();// Cancel default event handling
}
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>


边栏推荐
猜你喜欢

【论文笔记】Supersizing Self-supervision: Learning to Grasp from 50K Tries and 700 Robot Hours

Une citation classique de la nature humaine que vous ne pouvez pas ignorer

Utonmos adheres to the principle of "collection and copyright" to help the high-quality development of traditional culture

多媒体元素,音频、视频

Drawing structure diagram with idea
![[reading papers] fbnetv3: joint architecture recipe search using predictor training network structure and super parameters are all trained by training parameters](/img/84/2b66b513a0a36464233708fbb4b57d.png)
[reading papers] fbnetv3: joint architecture recipe search using predictor training network structure and super parameters are all trained by training parameters

Google recommends using kotlin flow in MVVM architecture

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

How to prompt

Lumen Analysis and Optimization of ue5 global Lighting System
随机推荐
使用IDEA画结构图
小米电视的网页和珠宝的网页
Add console programs in UE
PCA and automatic encoder for dimension reduction of R language
分割、柱子、list
类图
工作室第3次HarmonyOS培训笔记
[hash table] improved, zipper hash structure - directly use two indexes to search, instead of hashing and% every time
个人用同花顺软件买股票安全吗?怎么炒股买股票呢
开通基金账户是安全的吗?怎么申请呢
Good news | congratulations on the addition of 5 new committers in Apache linkage (incubating) community
校园创客空间的硬件造物原理
kotlin快速上手
Oracle exercise
MySQL数据库基础
力扣(LeetCode)175. 组合两个表(2022.06.24)
Cliquez sur le bouton action de la liste pour passer à une autre page de menu et activer le menu correspondant
Literature reading --- optimize RNA SEQ research to study herbicide resistance (review)
Route jump: click the operation button of the list to jump to another menu page and activate the corresponding menu
HL7Exception: Can‘t XML-encode a GenericMessage. Message must have a recognized struct