-1

I got this code from a book. In the browser it says "Howdy friend Take a look around..." So, the javascript code is not working and I can't understand why.

    <hl>Elderflower</hl> 
    <div id="content"> 
      <div id="title">Howdy 
      <span id="name">friend</span>!</div> 
      <div id="note">Take a look around . . . </div> 
    </div> 
    <script src="js/string-variable.js"></script>
    
    //javascript code
    
    var username; 
    var message; 
    username = 'Molly'; 
    message = 'See our upcoming range'; 
    var elName = document.getElementByld('name'); 
    elName.textContent = username; 
    var elNote = document.getElementByld( 'note'); 
    elNote.textContent = message;
  • `getElementByld` will not work, please check your console for obvious errors before posting questions – CertainPerformance May 29 '21 at 04:04
  • It's `getElementById` not `getElementByld`. I'm not sure if this font makes it clear but you have what looks like a lowercase L instead of a capital I – j08691 May 29 '21 at 04:14

0 Answers0