0

I have a requirement where in i have to set the link of the CEWP using jquery on a button click. The approach i was thinking of is : On button click , find the CEWP on the page. Change the link to the desired link.

But here, i am unable to find a script to search the CEWP on the page and change its link.

Can some one please help as it is urgent !! Please let me know, in case i am unclear anywhere in the explanation.

1 Answer 1

1

Why would you want to find the CEWP? If you add an ID to the link you want to change, just set your selector to that ID and you should be good to go.

$(document).ready(function () {
    $('#myLinkID').attr('href', 'new link here');
});

Always make sure to have IDs or somewhat unique classes you can use as selectors to better narrow down where the jquery should do changes.

Hope this helps :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.