CSS and javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bj

    CSS and javascript

    Hi,

    I would like to dynamically change an object's style in javascript but I
    didn't manage to do that.
    Here is an sample of my javascript code :

    function checkFileName(o bject) {
    var pattern = "<%=pr.getFiltr ePhoto()%>";
    if (!object.value. match(pattern)) {
    object.form["myInputBut ton"].disabled = true;
    //object.form["myInputBut ton"].class = 'MyDisabledClas sStyle';
    }
    else {
    object.form["myInputBut ton"].disabled = false;
    //object.form["myInputBut ton"].class = 'MyEnableClassS tyle';
    }
    }

    I didn't manage to access to the "class" properties. Is there a way to
    affect a predefined class style to an object ?

    thx,

    Bj
  • bj

    #2
    Re: CSS and javascript

    all right, I found the good property ! className

    Bj

    Comment

    Working...