I’m trying to manipulate the HTML through getElementsByClass() but for some reason it doesn’t work. When I use document.getElementByID() it works? Why is this?
<div class='boldStuff'> <p>Welcome to the site. </p> </div>
<script type="text/javascript">
document.getElementsByClass('boldStuff').innerHTML = 'Fred Flinstone';
</script>
Try: