I want to add some image background if my input has class valid.
I read documentation, read some stackoveflow questions ( like this -> hasClass doesn't work in my js code? ), but I’m failing to implement it in my modal.
Here is jsfiddle with all HTML and js -> http://jsfiddle.net/33PGQ/34/
Can someone suggest what is wrong ?
P.S.Also tried to write in hasClass function like this: div > form > …( did not work )
The issue is not
hasClassmethod, you selector is wrong, you should use.for class selectors, jQuery selectors work like CSS selectors.http://jsfiddle.net/q7jw5/