Reload the DOM probelm

An examaple of how you cannot maniuplate already Manipulated DOM elements

<!DOCTYPE html>
<html >
  <meta charset="UTF-8">
  <title>Reload the DOM probelm</title>
  <script src="" type="text/javascript"></script>

  <link rel="stylesheet" href="">

      <link rel="stylesheet" href="css/style.css">


  <div class='primary'>
  <div id='replacable'>
    <button id='replace-me'>click to replace</button>
  <div class='replacer' id='replacer1'>
    <button class='go-back'>go back</button>
    this is replacer1
  <script src=''></script>

    <script  src="js/index.js"></script>

/* Downloaded from */
.primary {
  width: 20em;
  height: 20em;
  margin: 5%;
  background-color: green;

#replacable {
  margin: 2.5em;
  width: 15em;
  height: 15em;
  background-color: blue;

.replacer {
  display: none;
/* Downloaded from */
$('#replace-me').on('click', function(){
  var content = $('#replacer1').html();
  var old_content = $(this).parent().html();
  $('.go-back').on('click', function(){

This awesome code ( Reload the DOM probelm ) is write by Steven Moore, you can se more from this user in the personal repository

You can find the original code on

2018 © Steven Moore