I created an element on-the-fly using javascript like:
myA=document.cr eateElement("A" );
myA.href="Javas cript:acton(thi s)";
myA.className = "smallLink" ;
myText=document .createTextNode ('sometext');
myA.appendChild (myText);
Then when I pressed the link I'd like to change the 'className' of this
link from 'smallLink' to 'biggerLink', but nothing happens.
function action(obj)
{
//alert(obj);
obj.className=" biggerlink";
}
When I look at alert(obj) I get "[object]".
When I look at alert(obj.class Name) I get "undefined" .
Anyone know what I am doing wrong here?
Mike
myA=document.cr eateElement("A" );
myA.href="Javas cript:acton(thi s)";
myA.className = "smallLink" ;
myText=document .createTextNode ('sometext');
myA.appendChild (myText);
Then when I pressed the link I'd like to change the 'className' of this
link from 'smallLink' to 'biggerLink', but nothing happens.
function action(obj)
{
//alert(obj);
obj.className=" biggerlink";
}
When I look at alert(obj) I get "[object]".
When I look at alert(obj.class Name) I get "undefined" .
Anyone know what I am doing wrong here?
Mike
Comment