M
Michael Hill
I created an element on-the-fly using javascript like:
myA=document.createElement("A");
myA.href="Javascript:acton(this)";
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.className) I get "undefined".
Anyone know what I am doing wrong here?
Mike
myA=document.createElement("A");
myA.href="Javascript:acton(this)";
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.className) I get "undefined".
Anyone know what I am doing wrong here?
Mike