tags:

views:

280

answers:

0

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(function() {
          editor.atte("value", "<b>This is new content.</b>");
      });

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

  });