jQuery Tutorial


jQuery Example


jQuery References


jQuery HTML replaceWith() Method Reference


  All jQuery with HTML Method References


Uses

jQuery replaceWith() method Replace selected elements with new contents.


Syntax

$("selector").replaceWith(content)

jQuery replaceWith() method supported following parameters.

ParameterDescription
contentcontent is Required parameter. content define replace on selected elements.

jQuery replaceWith() Method Example

<script type="text/javascript"> 
$(document).ready(function(){
  $("button").click(function(){
	$("p").replaceWith("<p>Web Development Tutorial</p>");
  });
});
</script>
Online Try This Code Your Self....   »

  All jQuery with HTML Method References