Jump to content
Stef's Coding Community

Search the Community

Showing results for tags 'innerhtml'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Community Lounge and FAQ
    • Forum News
    • Open Forum
    • New Members Forum - Start Here!
  • StudioWeb
    • StudioWeb
    • StudioWeb News
  • Programming
    • Python
    • Javascript
    • PHP
  • Entrepreneurship, Business and Marketing
    • Social Media Marketing & Web Marketing
    • Entrepreneurship
    • Career Questions - Asked and Answered
  • Web Design
    • Beginners Web Design
    • HTML/XHTML
    • Dreamweaver
    • CSS
    • Advanced Web Design
    • Business of Web Design
    • Web Design News
  • Miscellaneous
    • Cybersecurity
    • Miscellaneous Software
    • Blogs and CMS
    • Web Accessibility
    • Peer-to-Peer Reviews
    • Website Templates
    • Web Design Jobs
  • Archives
    • Beginners Web Design
    • Course: The Complete Entrepreneur
    • Web Accessibility
    • Photoshop
    • CSS
    • Forum Rules and Etiquette
    • Flash
    • ASP
    • General Programming
    • Expression Web
    • Beginners Ruby
    • Killersites University
    • Actionscript

Categories

There are no results to display.

There are no results to display.

Product Groups

  • Business & Entrepreneur Courses

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website


LinkedIn


Facebook


Twitter


AIM


Yahoo


Other


Location


Interests

Found 1 result

  1. I expect the browser to print the values from 10 to 1 in an empty p tag using JavaScript, but it's printing 1 to 10. Why does it print above the old line, and not below it? <!-- Button for printing "i" --> <input type="button" value="print i"> <!-- Empty p tag where the values of "i" will be printed --> <p></p> <script> // Function for printing "i" function print() { var i = 10; while(i > 0) { // Grabs the empty p tag var p = document.getElementsByTagName("p")[0]; // Prints the values of "i" on the p tag p.innerHTML = "i: " + i + "<br>" + p.innerHTML; i = i -1; } } // Calls the function for printing "i" document.getElementsByTagName("input")[0].onclick=function() { print(); } </script> test-standalone.html
×
×
  • Create New...