Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to unlink the selected link in HTMLEditor

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 424
    Comment on it

    Hello all,

    While working with HTML Editor, we wanted to give a functionality to user where He/She can selected a link inside the HTML Editor and he can Unlink it.

    To do this, we have this block of code.:

    var current = window.getselection();
    if (current.length > 0 && current.nodeName == 'A') {
       $current.replaceWith($current.contents());
     }
    else if ($(current).length > 0 && current.nodeName == 'A') {
         $(current).replaceWith($(current).contents());
    }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: