开发者

Adding class to a hyperlink

My CMS wont let me add a thickbox class to 开发者_如何学JAVAa hyperlink inline. It just keeps stripping out the class when I save.

Are there any ways to enforce tis class or a workaround?

Thanks

R


I assume you're editing a single page via a WYSIWYG editor, such as TinyMCE or similar. You have to check the editor's settings and make sure it won't strip the class attribute from your content. This will fix it, provided that the attributes aren't stripped in PHP on content submission.


Try to apply the class with the link editor if you've tried in source/html mode, or vice versa.

Also, I know some of these editors have some tags for content it shouldn't traverse through. Can't help since I don't know the CMS you use.


If you have ID to the link you can have such code:

window.onload = function() {
    document.getElementById("MyLink").className = "thickbox";
}

Otherwise can you set custom attributes without CMS removing them?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜