Click here to Skip to main content
11,930,679 members (53,863 online)
Rate this:
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 20:10pm
Edited 7-Dec-11 20:19pm
Mehdi Gholam292.7K
thatraja 8-Dec-11 1:23am
Not working
What's the error message? Check with javascript debugger.
SAKryukov 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 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 8-Dec-11 3:05am
OP commented:

Hello SAKryukov

Thanks for your reply. Let me check using jquery
SAKryukov 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 8-Dec-11 3:45am
SAKryukov 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151126.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