자바스크립트 document.getElementById()

by JM note

HTML

<p id='foo'>안녕 친구들</p>
 
<script>
document.getElementById('foo').style.backgroundColor = 'yellow';
</script>