Hello,
From a plugin I want to insert a new paragraph into the document.
The following works fine (at least in firefox)
var newBlock = document.createElement('p');
newBlock.className = 'myCSSClassName';
textNode = document.createTextNode('A new paragraph');
newBlock.appendChild(textNode);
FCKDomTools.InsertAfterNode(currentBlock, newBlock);
Now how do I insert a paragraph with no text? I want to simulate an enter key
changing the above to, does not work.
var newBlock = document.createElement('p');
newBlock.className = 'myCSSClassName';
textNode = document.createTextNode('');
newBlock.appendChild(textNode);
FCKDomTools.InsertAfterNode(currentBlock, newBlock);
Thanks in advance!
Dave
From a plugin I want to insert a new paragraph into the document.
The following works fine (at least in firefox)
var newBlock = document.createElement('p');
newBlock.className = 'myCSSClassName';
textNode = document.createTextNode('A new paragraph');
newBlock.appendChild(textNode);
FCKDomTools.InsertAfterNode(currentBlock, newBlock);
Now how do I insert a paragraph with no text? I want to simulate an enter key
changing the above to, does not work.
var newBlock = document.createElement('p');
newBlock.className = 'myCSSClassName';
textNode = document.createTextNode('');
newBlock.appendChild(textNode);
FCKDomTools.InsertAfterNode(currentBlock, newBlock);
Thanks in advance!
Dave
Re: Insert paragraphs into the DOM, simulate enter key
FCKEnterKey.DoEnter('br', false);
Dave
Re: Insert paragraphs into the DOM, simulate enter key
Re: Insert paragraphs into the DOM, simulate enter key