I edited the question as I found out the root cause of the issue. The code actually works just fine when I test it with alert. the thing is that sharepoint code seems to reset the value to true after the page is rendered. I spent quite long time trying to change the value of div from contentEditable = true to contentEditable = false. nothing has worked for me so far. I know the question has been answered more than one time and I did try all the proposed solutions unfortunately nothing worked for me. The code in a sharepoint 2010 site, and it is an internal environment so I can't use plugins as propsed in the this question I also tried the following method but it does not work:
function DisableDiv()
{
$('#ctl00_m_g_88fac340_3da6_4f2b_8785_0340d025790e_ctl00_ctl05_ctl15_ctl00_ctl00_ctl04_ctl00_ctl00_TextField_inplacerte').prop('contentEditable',false);
}
The default div code looks like this:
<td valign = "top" Class="ms-formbody">
<!-- FieldName="QBIQ (Title)"
FieldInternalName = "QBIQ_x0020_description"
FieldType = "SPFieldNote"
-->
<span dir = "none" <>
div Class='ms-rtestate-field ms-rtefield'
style =''><div id='ctl00_m_g_74c26ddd_a3bd_4c7b_877d_6a60c1035973_ctl00_ctl05_ctl15_ctl00_ctl00_ctl04_ctl00_ctl00_TextField_inplacerte_label'
style ='display:none'>Rich text editor QBIQ (Title)</div>
<div class=' ms-rtestate-write ms-rteflags-0' id='ctl00_m_g_74c26ddd_a3bd_4c7b_877d_6a60c1035973_ctl00_ctl05_ctl15_ctl00_ctl00_ctl04_ctl00_ctl00_TextField_inplacerte'
style='min-height:42px' aria-labelledby='ctl00_m_g_74c26ddd_a3bd_4c7b_877d_6a60c1035973_ctl00_ctl05_ctl15_ctl00_ctl00_ctl04_ctl00_ctl00_TextField_inplacerte_label' contentEditable='true'>
<div class="ms-rtestate-field">QBIQ no & (Title) field value.</div></div> < div style="clear:both;"></div></div>
<span dir="ltr">
<input name = "ctl00$m$g_74c26ddd_a3bd_4c7b_877d_6a60c1035973$ctl00$ctl05$ctl15$ctl00$ctl00$ctl04$ctl00$ctl00$TextField_spSave"
type="HIDDEN" id="ctl00_m_g_74c26ddd_a3bd_4c7b_877d_6a60c1035973_ctl00_ctl05_ctl15_ctl00_ctl00_ctl04_ctl00_ctl00_TextField_spSave"/>
</span>
</span>
</td>
What I'm missing? and apology for asking an old question.