JQuery (1.4.2)/Firefox (3.6.3) - .before and .after not working on div

Posted by user355561 on Stack Overflow See other posts from Stack Overflow or by user355561
Published on 2010-06-01T15:19:46Z Indexed on 2010/06/01 15:23 UTC
Read the original article Hit count: 125

Filed under:
|
|

I am trying to have a title bar appear when the user clicks on a box. It works perfectly in I.E. 8.0 but not at all in firefox 3.6.3.

HTML [code]

@import url('style.css');

blah blah blah

save changes

[/code]

Javascript [code] $(document).ready(function(){ $("#edit2").live('click',function(){ if($("#menu").length == 0){ $("#edit2").before(''); } if($("#menu2").length == 0){ $("#edit2").after(''); } this.contentEditable = true; this.focus(); });

$("#edit2").live('blur',function(){ $("#menu").remove(); //$("#menu2").remove(); this.contentEditable = false; }); }); [/code]

Could anyone suggest why it's not working? I have managed to use similar code to add/remove new table rows in both browser but I just can't see why this doesn't also work.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about firefox