본문 바로가기
Javascript

제이쿼리) 수정버튼클릭하면 인풋창뜨게하기_.click사용

by jennyiscoding 2022. 6. 24.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $("p").html(`<input>버튼클릭했더니인풋창뜨게</input>`);
  });
});
</script>
</head>
<body>

<button>Change content of all p elements</button>

<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

</body>
</html>