Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    rao
    rao is offline
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Creating TD (cell) to a TR using javascript

    Hi,

    I am trying to create a TD to a TR & setting the TD properties as follows.

    myTabsRow=document.getElementById("tabsRow"); newCell=myTabsRow.insertCell(myTabsRow.cells.length);
    newCell.id=tabName+"_data";
    newCell.innerHTML="Test"
    newCell.onclick=domouseclick('test'); // domouseclick is defined as

    function domouseclick(argName)
    {
    alert(argName);
    }


    Problems is that i am not able to pass argument to the domouseclick function. It is working fine without the argument. Please help me if anybody knows how to pass argument to this function.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,042
    Thanks
    0
    Thanked 251 Times in 247 Posts
    newCell.onclick=function(){domouseclick('test');};


  •  

    Posting Permissions

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