开发者

How to get a href of drag and drop

checking this sample. http开发者_运维百科://html5demos.com/drag

i was wonder how to get when You drop a < li >. (by href)


If I understand you correctly: You want to get the href attribute of the element being dropped? If so you can view source on that page and look on line 131.

var el = document.getElementById(e.dataTransfer.getData('Text'));

the el element has an href attribute so you can do: el.href and that will give you the href you are asking for and in this case it will return html5demos.com/drag#

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜