Forum Discussion

jeffshurtliff's avatar
5 years ago

Trying to use jQuery and liaAddScript to add anchor to TKB article

I'm trying to use the liaAddScript directive in a custom component and jQuery to add anchors to TKB articles that have specific CSS classes but it doesn't seem to want to work. This is what my custo...
  • saikumarn's avatar
    5 years ago

    Hi jeffshurtliff 

    Please use dot (.) before class name.

    Ex: 

     

    <@liaAddScript>
      ; (function ($) {
    	console.log('Adding anchor to article');
        $('<a name="appliesTo">your link</a>').insertBefore(".kbsync-applies-to");
      })(LITHIUM.jQuery);
    </@liaAddScript>