Why doesn't this code work?



  • document.getElementById('button').onclick = function () {
        document.getElementById('choise_area').innerHTML = '<input id="new"  value="Нажми Меня" onclick="alert('Спасибо!');" type="button"/>
        return false;
    }
    


  • document.getElementById('button').onclick = function () {
      document.getElementById('choise_area').innerHTML = '' +
       '<input id="new" value="Нажми Меня" type="button" onclick="alert(\'Спасибо!\');">';
    
      return false;
    }
    
    1. Ecranate (ibid.)
    2. Close the carpets.

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2