JQuery (1.4.2)/Firefox (3.6.3) - .before and .after not working on div
- by user355561
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.