Reputation: 25
I have a plugin that enable users to add on a caption to a image if they want to, using the title attribute. I would like to find out, if I allow them to do this :
<img title="I am a <myplugin-a>caption</myplugin-a>" src="imagelink" />
and then in my js, I would do a replace for "myplugin-".
Would this lead to any problems in terms of validation?
Upvotes: 0
Views: 66
Reputation: 943207
It wouldn't lead to validity problems (less then and greater than characters are allowed as data in title attributes), but it would mean your HTML would be nonsensical if the JS wasn't applied (users may have JS disabled, a JS file may fail to load, a search engine indexer usually won't execute any JS, etc).
Upvotes: 4