Click here to Skip to main content
11,790,816 members (58,889 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET Javascript CSS jQuery IE8 , +
Hello everybody
I want to make my website faster so, i have decided to use Javascript validation.
I have created javascript validation. Validations are working properly in Firefox and chrome but it is not working in IE.

For e.g
 spfname.innerHTML = '<img src="img/true.png" alt="" /> Success';
return true;

classList.remove property is working in firefox and chrome but it is not working in IE.
same way classList.add property.

Please reply me how to resolve this problem.

Posted 7-Dec-11 19:10pm
Edited 7-Dec-11 19:19pm
Mehdi Gholam288.5K
thatraja at 8-Dec-11 1:23am
Not working
What's the error message? Check with javascript debugger.
SAKryukov at 8-Dec-11 1:47am
No error messages of course, just no effect of added/removed class.
I found alternative solution which works correctly, please see.
shailesh125 at 8-Dec-11 2:59am
Hello SAKryukov

Thanks for your reply. Let me check using jquery

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hm! It just tried it, it's true!

My idea was to try jQuery. As I thought, the equivalent solution with jQuery worked correctly:


Please try it — jQuery is written with compatibility in mind. I did not look how jQuery works around the problem in JavaScript code, but it certainly works the same way on the Browsers I tested: Mozilla Seamonkey vs. IE vs. Google Chrome.


I don't see initialization of the variables fname and spfname in your code but assumed they are objects correctly representing DOM elements, so they could serve as valid parameters to the jQuery $() function, which can also accept different types of parameters (selectors using IDs, classes, XPath queries and the combinations of those) and return jQuery wrapper objects representing a set of DOM elements, with a number of functions.

SAKryukov at 8-Dec-11 3:05am
OP commented:

Hello SAKryukov

Thanks for your reply. Let me check using jquery
SAKryukov at 8-Dec-11 3:07am

You are very welcome, but please, don't post anything using "Add your solution" unless this is a real solution. Please add comment or reply to existing comment; in other cases, use "Improve question".

Good luck,
koolprasad2003 at 8-Dec-11 3:45am
SAKryukov at 8-Dec-11 10:43am
Thank you, Prasad.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 385
1 ppolymorphe 339
2 Richard MacCutchan 118
3 Maciej Los 70
4 George Swan 70
0 OriginalGriff 1,154
1 Maciej Los 825
2 KrunalRohit 686
3 ppolymorphe 660
4 CPallini 621

Advertise | Privacy | Mobile
Web04 | 2.8.1509028.1 | Last Updated 8 Dec 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100