Hi, I have a javascript page which I am looking at localising. I have the translation handled, however one thing I am having difficulty with is the best way to handle which text to set. Obviously, for a button I should set the title / value. For a span probably the innerHTML / innerTEXT and for an image the alt. I was wondering if there is any function in JQuery which will allow me to call a generic function which will set the alt or value or innerHTML based on the nodeType.
basically a nice way of doing this:
if(this.nodeName == "input")
{
this.value = "newButtonText"
}
if (this.nodeName == "SPAN")
{
this.innerHTML = "newSpanText";
}
any help would be handy.
Thanks
John