代码
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="js/jquery.js"></script>
<style>
div{
width: 100px;
height: 100px;
background-color: darkgrey;
}
</style>
</head>
<body>
<div><p>我是文字</p></div>
<script type="text/javascript">
$(function(){
$("div").on("click",function(){
$("div").html("<p>我是子元素</p>")
});
});
</script>
</body>
</html>
效果图