Jeff Hu Jeff Hu - 4 months ago 10
jQuery Question

What is .$ means for in CKEditor?

I am currently looking into some plugins of CKEditor. Here is the code I encountered:

var dummyElement = editor.document.createElement('span');
var obj = dummyElement.$;


The plugin comes from here.

What is .$ means for in this context? Does it also supported in jQuery or other libraries?

Answer

$ is a perfectly valid variable or property name so without digging into the source code (or docs) and seeing what is assigned there is no way to know from your snippet alone what it is used for

As seen here you can do anything with it

var obj ={ $: 'foo'}
alert(obj.$);// "foo"