disappearing content in a table cell

hi,
i have a table which has one row and two columns. In the left column is a hyperlink. When the user clicks on this link, I want some content to be shown in the right column...here is what I have been trying...
[code]



#tableLeft {
border-right-style:double;
border-right-color:#FF0000
}


function showCode() {
document.content = eval(document.getElementById('content'));
document.content.innerHTML = "testing...";
}


Below are some Javascript scripts! More to come...




[/code]

when on i click on "Alert box" link...the words "testing..." appear in the right column and then disappear. why is this happening??

Comments

  • : hi,
    : i have a table which has one row and two columns. In the left column is a hyperlink. When the user clicks on this link, I want some content to be shown in the right column...here is what I have been trying...
    : [code]
    :
    :
    :
    : #tableLeft {
    : border-right-style:double;
    : border-right-color:#FF0000
    : }
    :
    :
    : function showCode() {
    : document.content = eval(document.getElementById('content'));
    : document.content.innerHTML = "testing...";
    : }
    :
    :
    :
    :


    : Below are some Javascript scripts! More to come...
    :

    :
    :
    : : : :

    :

    :
    :
    :
    : [/code]
    :
    : when on i click on "Alert box" link...the words "testing..." appear in the right column and then disappear. why is this happening??
    :


    however, if i change the "onClick" to "onMouseOver"..the text does not disappear.
  • : : hi,
    : : i have a table which has one row and two columns. In the left column is a hyperlink. When the user clicks on this link, I want some content to be shown in the right column...here is what I have been trying...
    : : [code]
    : :
    : :
    : :
    : : #tableLeft {
    : : border-right-style:double;
    : : border-right-color:#FF0000
    : : }
    : :
    : :
    : : function showCode() {
    : : document.content = eval(document.getElementById('content'));
    : : document.content.innerHTML = "testing...";
    : : }
    : :
    : :
    : :
    : :


    : : Below are some Javascript scripts! More to come...
    : :

    : :
    : :
    : : : : : : : :

    : :

    : :
    : :
    : :
    : : [/code]
    : :
    : : when on i click on "Alert box" link...the words "testing..." appear in the right column and then disappear. why is this happening??
    : :
    :
    :
    : however, if i change the "onClick" to "onMouseOver"..the text does not disappear.
    :


    I solved it!! In my hyperlink, the href was set to "" instead of "#"..so it was reloading the page! haha


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion