Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4079144
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:45:50+00:00 2026-05-20T17:45:50+00:00

Hey, I am working on a simple Plugin for CKEditor, I am not to

  • 0

Hey, I am working on a simple Plugin for CKEditor, I am not to firm with JavaScript, so here is my problem.

I upload an image and insert it with a dialog, producing something like this.

<div class="float-right image">  
<img alt="alt-text" src="img.jpg" />   
<span class="caption">Caption</span>  
</div>

Works like a charm, but once i is inserted I want to be able to edit it.
Doing so I can get the alt attribute and the src of the image via

var elem = this.getParentEditor().getSelection().getSelectedElement();

and working with getAttribute(‘…’). But I can not figure out how to reach, the caption and the div.

I would be very happy if you could help me. Thanks in advance.

BTW: Is there a possibility to use jquery within a plugin for CKEditor?

Heres the solution:

So what I came up with in the end, thanks to all the help here.
In the dialog part:

onShow : function()
{
elem = this.getParentEditor().getSelection().getSelectedElement();
var span = elem.getNext();
var parent = span.getParent();
}

this gives me all the stuff I need to fill into the dialog once I open it again.

to submit everything I needed to find out how to change the current selection. This works like this:

onOk:
function()
    {
editor.getSelection().selectElement(editor.getSelection().getSelectedElement().getParent());
editor.insertHtml('<div ...</div>');
}

Thank you guys, I only started digging into the CKEditor Plugins today and already I got two nice ones.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T17:45:51+00:00Added an answer on May 20, 2026 at 5:45 pm

    With the CKEditor API you can use .getNext()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey guys, I have no luck making a simple background image animation working without
Hey guys, I was working on a simple chat program to brush up on
Hey guys, I'm working on a status-Updater. It works, there is just one problem,
Hey I'm working on a problem where you would print a string vertically using
Hey I'm working on a startup and I've got to build a simple database
Hey, so I'm trying to build a simple lan game using sockets (not tcpclient
Hey all, I cannot seem to get a simple ajax working between a php
Hey there, I have a simple problem but can't seem to get the solution
Hey my Delete and SearchByEmail methods are not working. Delete basically asks all the
Hey I am a java programmer working on a HTML/CSS/JavaScript project. At the moment,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.