<!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>
'Javascript' 카테고리의 다른 글
함수의 호출과 반환의 차이 (0) | 2022.07.07 |
---|---|
호이스팅 (0) | 2022.06.28 |
비구조화할당 (0) | 2022.06.28 |
javascript 코드 버튼 누를때마다 홀짝홀짝 나오는 코드 (0) | 2022.06.08 |
javascript 처음 써보기. style테그 밑에다가 function만들기 (0) | 2022.06.08 |