Programatorul de la A la ZI Programatorul de la A la ZI V1.2 Beta - In curand se va face lansare.
 
 
 You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time.Bertrand Meyer 
 
 
Seteaza un atribut pentru un obiect - Cod Sursa
Descriere
Functia "seteaza" un atribut pentru un obiect .

Cod      - Testeaza 

function SetAttribute(object, attrName, attrValue) {
if (document.getElementById) {
if (object.hasAttribute) {
if (object.hasAttribute(attrName)) {
if (object.getAttribute) {
if (object.getAttribute(attrName) == attrValue) {
return true;
}
}
if (object.removeAttribute) {
object.removeAttribute(attrName);
}
}
}
if (object.setAttribute) {
object.setAttribute(attrName, attrValue);
return true;
}
var attr = document.createAttribute(attrName);
if (attr) {
attr.nodeValue = attrValue;
if (object.setAttributeNode) {
object.setAttributeNode(attr);
return true;
}
}
}
return false;
}

function SetAttributeByID(objectID, attrName, attrValue) {
if (document.getElementById) {
var object = document.getElementById(objectID);
if (object) {
return SetAttribute(object, attrName, attrValue);
}
}
return false;
}

V1.2 Beta - In curand se va face lansare.

Copyright 2007 © . Toate drepturile rezervate .