开发者

How to get a value from Dijit.Editor?

I have a dijit.editor on my page and when I click on a button I want the contents inside my editor. It should be fairly simple, but I've stumbled upon it for now.

Never mind, i solved it.

   dojo.require("dijit.Editor");

  dojo.addOnLoad(function() {
      var editor = dijit.byId("myEditor");
      var btn1 = dojo.byId("Button1");

      editor.attr("value", "Hej igen"); 
      editor.onLoadDeferred.addCallback(f开发者_如何转开发unction() {
          editor.atte("value", "<b>This is new content.</b>");
      });

      btn1.onclick = function() {
          //  alert(editor.domNode.innerHTML);
      alert(editor.attr("value"));
      }

  });


As marko has pointed out, you can get the value by:

editor.attr("value")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜