Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find index of < symbol in a string

Status
Not open for further replies.

meenu24

Programmer
May 5, 2006
37
US
Hi
I am the following encoder to unencode by < symbol. This unencoder worked for &nbsp quite well. Thanks to Adam again.
String.prototype.htmlUnencode = function(){
var div = document.createElement("div");
div.innerHTML = this;
return div.innerText;
}
var str = "<sometext";
str.htmlUnecnode(); - this returns me a blank string always.
I am trying to find if a string contains "<" symbol using indexOf function. For that I am unecodign the String then passing to indexOf function.
Where am I going wrong.

thanks



 
I fixed the typo, still I did have the problem, but I had a work around, which did not involve the "<" symbol removal.

Thanks for the followup

Meena

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top