Results 1 to 2 of 2

Thread: InnerHTML horizontal row problem

  1. #1
    Join Date
    Jan 2016
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default InnerHTML horizontal row problem

    I want to add a horizontal row after the user clicks on Completed. This javascript isn't working:

    Code:
    function myFunction() {
        document.getElementById("green-hr").innerHTML = "<b>Completed</b><br /><hr />";
    }
    
    <b onclick="myFunction()" id="green-hr">Completed</b>
    How to fix it?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
    </head>
    <body>
    <b onclick="myFunction()" id="green-hr">Completed</b>
    <script type="text/javascript">
    function myFunction() {
        document.getElementById("green-hr").innerHTML = "<b>Completed</b><br /><hr />";
    }
    </script>
    
    </body>
    </html>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. Horizontal CSS Menu IE Problem?
    By netsynter in forum CSS
    Replies: 0
    Last Post: 04-09-2011, 09:23 AM
  2. Resolved innerHTML problem (Javascript AJAX IE 8)
    By Abid in forum JavaScript
    Replies: 4
    Last Post: 06-08-2010, 07:51 AM
  3. Horizontal css menu too many problem
    By Psygnosis in forum CSS
    Replies: 3
    Last Post: 03-27-2009, 03:04 PM
  4. IE6 innerHTML + img problem.
    By jlizarraga in forum JavaScript
    Replies: 7
    Last Post: 07-17-2008, 06:19 PM
  5. horizontal li problem
    By Peter Johnson in forum CSS
    Replies: 1
    Last Post: 06-02-2007, 09:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •