jQuery mousedown() append element

Description

jQuery mousedown() append element

View in separate window

<!DOCTYPE html>
<html>
<head>
<script 
 src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">
</script>/*from ww  w  .ja  v  a2  s  .  c om*/
<script>
$(document).ready(function(){
  $("div").mousedown(function(){
    $(this).after("<p>new added.</p>");
  });
});
</script>
</head>
<body>

<div style="color:red;">Press down the mouse 
button over this div element.</div>

</body>
</html>



PreviousNext

Related