i am facing some strange behavior of different browser.i have fallowing condition in my javascript which is working fine in Mozilla and chrome but not in IE.
if(sValue.indexOf('<br>')!=-1){
// do something
}
when i changed my code in fallowing way , then it’s working fine in IE but not in Mozilla and chrome.
if(sValue.indexOf('<BR>')!=-1){
// do something
}
anybody knows why it’s happening like this?.
Thanks in advance!!!!
I would hazard a guess that you are getting the browser to serialize the DOM to HTML to get the value for
sValue. HTML is case insensitive, so browsers are free to use whatever case they like for tag names.The solution is
String.toLowerCase()