开发者

Using jQuery, can you paste a rectangle by clicking a button?

开发者 https://www.devze.com 2023-02-17 06:33 出处:网络
If you are using jQuery and have a CSS class called .draggable_rectangle, how can开发者_高级运维 you create a button that will draw a copy of the rectangle each time the user clicks the button?<but

If you are using jQuery and have a CSS class called .draggable_rectangle, how can开发者_高级运维 you create a button that will draw a copy of the rectangle each time the user clicks the button?


<button id="copy_rectangle"></button>
<script>
$("#copy_retangle").click(function(){
  $(".draggable_rectangle").clone().appendTo("body");
  // add extra code to make it draggable
});
</script>
0

精彩评论

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