Cool! You can do this with vanilla JavaScript, I managed to get this working for most elements (text elements like h1, h2... and p don't seem to work properly, you can probably fix it somehow, I just can't be bothered). This will work for things like divs, inputs and textareas e.t.c. My attempt at draggable elements
How 2 Make A Draggable HTML Element!
How 2 Make A Draggable Element! (HTML)
Step 1
We first need to get the
JQuery
libraries.Copy and paste this:
Credits Go To code.jquery.com For The Libraries!
Step 2
For our actual
JQuery
code, we have:The dragging works for:
id
attributeclass
attributeUsing Id
The name of an element's id goes before an
#
symbol, like this:Using Class
The name of an element's class goes before an
.
symbol, like this:Downsides
inputs
andtextareas
div
The Tutorial Is Done.
Bye!
Cool! You can do this with vanilla JavaScript, I managed to get this working for most elements (text elements like
h1
,h2
... andp
don't seem to work properly, you can probably fix it somehow, I just can't be bothered). This will work for things likediv
s,input
s andtextarea
s e.t.c.My attempt at draggable elements
nice
@MattDESTROYER