![]() |
Working on HTML Enities in Javascript
IntroductionSome characters are reserved in HTML. For example, you cannot use the greater than or less than signs within your text because the browser could mistake them for markup. If we want the browser to actually display these characters we must insert character entities in the HTML source. A character entity looks like this: &entity_name; OR &#entity_number; To display a less than sign we must write: < or < The advantage of using an entity name instead of a number is that the name often is easier to remember. However, the disadvantage is that browsers may not support all entity names (while the support for entity numbers is very good). The CodeI have made to subroutines to enityfy and unentityfy strings. You'll need jQuery to use this code. Code: JavaScript
Referenceshttp://www.w3schools.com/HTML/html_entities.asp |
Re: Working on HTML Enities in Javascript
Nominate this article for Article of the month for February 2009
|
Re: Working on HTML Enities in Javascript
How can we create design in html with the help of java script ?
|
Re: Working on HTML Enities in Javascript
In this coding Working on HTML Enities in Javascript
Code:
<input type="text" id="x" value=""> |
Re: Working on HTML Enities in Javascript
@gkumar: for this the html element with id 'x' has to be present, and moreover it just sets the html entity.
|
| All times are GMT +5.5. The time now is 07:09. |