1

I've a problem with loading new class from my CSS file. Actually, I think it is some thing else because if I try to change the background to red just to check if it is working, nothing happens

function logging_error()
{
    $html = new DOMDocument();
    @$html->loadHTML("login.php");
    $divToShake = $html->getElementsById('login_form');
    $divToShake->setAttribute("background-color", "red");
    $divToShake->item(0)->class = 'shake';
    //echo $divToShake->getAttribute('class') ;
}
0

2 Answers 2

3

The problem is that you have an extra s in getElementsById(). It should be:

$divToShake = $html->getElementById('login_form');
Sign up to request clarification or add additional context in comments.

1 Comment

oh my ! sorry i spent so much time figuring it out but after changing i just get blank page :(
0

What about this ?

$divToShake->setAttribute("style", "background-color: red;");

or maybe this

$divToShake->setAttribute("background", "red");

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.