www.webdeveloper.com
Results 1 to 3 of 3

Thread: events in innerHTML

Hybrid View

  1. #1
    Join Date
    Jul 2013
    Posts
    2

    events in innerHTML

    I have a table with x rows & y columns.

    The innerhtml for a cell is a unique value that is updated onchange:

    HTML Code:
    <td></td><input value="what the f ever" id="10" style='width:125px;text-align:center' onchange='updateinput("table",this.value,1,0)' /></td>
    Code:
    function updateinput(tablez,ish,xcor,ycor)
    {
    var insert_text = "<td></td><input value=" + "\"" + ish + "\" id=" + "\"" + xcor + ycor + "\" style='width:125px;text-align:center' onchange='updateinput(" + tablez + ",this.value," + xcor + "," + ycor + ")' /></td>";
    
    var insert_html = document.getElementById(tablez).rows[xcor].cells[ycor];
    insert_html.innerHTML = insert_text;
    }
    Problem is that the onchange event only gets triggered once. Even when I manually change the value of the input box for a second time. Is there something I'm missing so that I can make more than one onchange event?

  2. #2
    Join Date
    Jul 2013
    Posts
    2
    got it. nevermind.

  3. #3
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,356
    So what did you change to make it work?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles