This is a migrated thread and some comments may be shown as answers.

Adding a custom attribute to an HTML element

2 Answers 237 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 03 Aug 2011, 08:50 PM
Is there a simple way to add a custom attribute to a selected HTML element?

For example, I want to add an ID attribute to H1 tag for use with an anchor link.  I was using standard anchor tags, but the issue is that they are not visible in edit mode.  It makes working with anchors for non-HTML savvy people very hard.

Any ideas would be greatly appreciated.

2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 04 Aug 2011, 08:43 PM
Hi Mark,

You can visualize the anchors in the content area using the following KB article:
http://www.telerik.com/support/kb/aspnet-ajax/editor/making-named-anchors-visible-in-editing-area.aspx

Regards,
Rumen
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Mark
Top achievements
Rank 1
answered on 05 Aug 2011, 05:32 PM
I tried implementing the functionality outlined in the post, but I had some issues.  I am delivering the editor from an assembly and I cant seem to register the script block at the right time.  I also tried putting the JS in the resource file I am already including from the assembly with no luck.

I figured out a work around where I am wrapping the anchor tags around text and applying a CSS class to hide the hyperlink appearance that is applied with an anchor tag, even if an href attribute isn't present.

Thanks for the response.
Mark
Tags
Editor
Asked by
Mark
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Mark
Top achievements
Rank 1
Share this question
or