JavaScript doesn' t elaborate innerHTML, here' s my code

my code doesn’ t work, and it’ s doing like this from a lot of time.
Please, could someone help me?

<button onclick="r()">Click Me</button>
<br />
<div id="div"></div>
<script>
    var x = 0;
    var div = document.getElementById('div');
    p.innerHTML = x;
    function r() {
        x += 1;
        p.innerHTML = x;
    }
</script>

176 thoughts on “JavaScript doesn' t elaborate innerHTML, here' s my code”

  1. I simply could not go away your site before suggesting that I extremely enjoyed the usual information a person provide for your visitors? Is going to be again continuously in order to inspect new posts.

    Reply
  2. hello there and thank you for your information – I have certainly picked up anything new from right
    here. I did however expertise a few technical points using this website,
    as I experienced to reload the web site a lot of times previous to I could get it to load properly.
    I had been wondering if your hosting is OK? Not that I am complaining,
    but slow loading instances times will often affect your placement in google and can damage your high quality score if advertising
    and marketing with Adwords. Well I am adding this RSS to my email and can look out
    for a lot more of your respective intriguing content. Ensure that you update this again very soon.

    Reply
  3. Hi, i read your blog occasionally and i own a similar one and i
    was just curious if you get a lot of spam comments?
    If so how do you prevent it, any plugin or anything you can suggest?
    I get so much lately it’s driving me mad so any help is very
    much appreciated.

    Reply
  4. whoah this weblog is excellent i really like reading your articles.
    Stay up the good work! You already know, a lot of persons are looking around for this information,
    you could aid them greatly.

    Reply
  5. Excellent post. Keep posting such kind of info on your page.

    Im really impressed by your blog.
    Hi there, You have done a great job. I’ll definitely digg it
    and personally suggest to my friends. I’m sure they will
    be benefited from this site.

    Reply
  6. You really make it appear really easy with your presentation however I to find this topic to be really something which I believe I would by no means understand. It kind of feels too complicated and very wide for me. I am taking a look ahead to your subsequent put up, I will attempt to get the grasp of it!

    Reply
  7. Thanks a bunch for sharing this with all of us you actually know what you’re talking about! Bookmarked. Please also visit my web site =). We could have a link exchange agreement between us!

    Reply
  8. Attractive section of content. I just stumbled upon your weblog and in accession capital to assert that I get in fact enjoyed account your blog posts. Anyway Ill be subscribing to your feeds and even I achievement you access consistently rapidly.

    Reply