Jump to content

How to create custom HTML Tags and Attributes


vijay1440

Recommended Posts

Hi All!In dojo toolkit I found that they are embedding widgets in HTML by custom HTML Attributes like below,<DIV dojotype="Titlepane"></DIV>Where the dojotype Attribute for the Div has been added by the DOJO. And by adding that attribute, that div has become Movable, resizable..etc. And the styles are also applied to that div. I would like to request you all to please let me know if you know how this could be achieved. Thank you all in advance,Vijay

Link to comment
Share on other sites

It's not valid HTML, but you can always tell Javascript to perform actions on elements that have a certain attribute, which is most likely what that's for.Of course, to make it movable and resizeable you're going to have to write the script that moves and resizes it, which is a complicated job.

Link to comment
Share on other sites

Hi Ingolme!Thank you very much for Your suggestion. Can you please let me know how to suggest the javascript to take some action when it encounters a user defined attribute?Once again, thanks a lot for your response.Thank you,Vijay

Link to comment
Share on other sites

window.onload = function() {	tag = document.getElementsByTagName("tag");	foreach (x in tag) {		if (tag[x].getAttribute("attribute") != null) {			takeAction(tag[x]);		}	}}

Link to comment
Share on other sites

Hi Synook!Thank you very much. Though I was already familiar with that method document.getElementsByTagName, i did not get this idea.Once again, Thank you very much.Are there any other approaches as well? Please respond if you know any.Best regards,Vijay

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...