How to set the href attribute
Question
Hi @artf,
Please let us know how we can set the href attribute of anchor inside div when element is dragged i.e
<div class="social_icons rrssb-buttons c3250"> <a href="https://www.facebook.com/sharer/sharer.php?u=http://starteo.softobiz.com" class="popup rrssb-facebook" id="ibvm"><i aria-hidden="true" class="facebookSocial fa fa-facebook"> </i></a> <a href="https://twitter.com/intent/tweet?text=https://rrssb.netlify.com/" class="popup rrssb-twitter" id="iuhg"><i aria-hidden="true" class="fa fa-twitter" id="iayz"> </i></a> <a href="mailto:?Subject=your%20subject" class="rrssb-email" id="i6ji"><i aria-hidden="true" class="fa fa-envelope" id="icv33"> </i></a> <a href="http://www.linkedin.com/shareArticle?mini=true&url=http://rrssb.ml&title=Ridiculously%20Responsive%20Social%20Sharing%20Buttons&summary=Responsive%20social%20icons%20by%20KNI%20Labs" class="popup rrssb-linkedin" id="ii5ni"><i aria-hidden="true" class="fa fa-linkedin" id="i0ukq"> </i></a> </div>I want to update href of first anchor tag without using editor.getHTML() but using below code it add href on div i.e
model.set('attributes', {'href': 'https://www.facebook.com/sharer/sharer.php?u='});
I am using latest library.
Answers (3)
@Deepak813 I guess that it isn't in model, it should be something like:
editor.getSelected().set('href', 'https://www.facebook.com/sharer/sharer.php?u=')
You don't need to access model
Hi @JulyanoF,
Thanks for the message,
I have used this code when element is dragged but display following error:
Uncaught TypeError: Cannot read property 'set' of null.
As i want to update the href of anchor tag inside the div when element is dragged.
@Deepak813 Oh, you want to change anchor when is draggin/dropping?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1111
How to add parent class when drag element
Hi @artf, Hope you are doing fine. Please let us know how we can add the parent class of div when new element is dragged inside that div li...
Issue #1105
add class in existing element
Hello previous issue can you please let me know how can add a new class on map element? I don't want add class manually on element through...
Issue #740
How to remove class from html
Hi @artf, We are updating the <i> tag class but it adds new class to this but previous class is not remove.please let us know how to remove...
Issue #750
How we can set the time and time zone in count down
Hi @artf , Please let us know that how we can set the time and timezone in count down as it is important in countdown element.Also, we come...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.