Posts

Showing posts from November, 2011

Custom HTML Tags using JavScript

Custom Tags in HTML using JavaScript. Browsers allow us to use a predefined set of HTML tags. There are times when we want to use our own tags in our html documents. Custom tags in server side scripting Server side scripting languages have the feature of adding our own tags to the server side scripts such as jsp. For example we use jsp tag libraries to achieve this in java. There is no big magic in this. The tag library actually prints a creates a HTMl code snippet for the given tags and replace the original html with these constructed HTML. The custm tag is converted to html before it is seen by the browser. But at the end the browsers see only predefined html tags. Custom tag in JavaScript Is it possible to make the browser react to a custom tag when it encounters such one in the DOM? This is possible using JavaScript, when the browser encounters your custom tag, it can handl it like any other valid predefined tag. Consider we have custom tag  <mytag id="mtag...