开发中遇到 通过 $("#content").val(); 或者 document.getElementById("content"); 并不能获取到 id 为 content的值

   $("#content").val(--赋值的信息--); 也不能为 id 为 content 赋值;

  页面代码:

  

      <tr>
               <td class="p12">内容:</td>
               <td colspan="3">
                 <fck:editor id="content" basePath="${ctx}/scripts/fckeditor/" skinPath="skins/office2003/">                                                 
           </fck:editor> </td> </tr>

 

  js 获取值的方法:

   

        var oEditor = FCKeditorAPI.GetInstance('content');//content为fck实例的id
        var content = oEditor.GetXHTML(true);

  

  赋值的代码:

        var oEditor = FCKeditorAPI.GetInstance("content") ;  
        oEditor.SetHTML(--赋予的值--) ;  

 

           就这么愉快的解决了~    

相关文章:

  • 2021-11-30
  • 2021-07-10
  • 2022-02-09
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
猜你喜欢
  • 2021-11-29
  • 2021-09-29
  • 2021-11-24
  • 2021-08-24
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
相关资源
相似解决方案