상세 컨텐츠

본문 제목

[자바스크립트] html에서 쿼리 바꾸기

카테고리 없음

by esoesmio 2023. 5. 18. 03:31

본문

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<span>변경젼</span>
<script>
    // 콘솔에서 실행한 뒤 결과 확인
    document.querySelector('span').innerText = '텍스트 변경됨';

</script>
</body>
</html>

댓글 영역