How to manipulate a dom element added to this.content inside a control

edited October 2013 in Newbie Questions
Hi, I'm building a control in which I need to access the dom but the included example that changes the background cell to red does not work.

How would this be done?

My code is as follows:

               enyo.kind({
                   name: "PanelToggleButton",
                   kind: enyo.Control,
                   allowHtml: true,
                   content: "",

                   published: {
                       element: "",
                   },

                   create: function () {
                       this.inherited(arguments);
                       var tabletxt = "";
                       tabletxt += "<table width='100%'><col style='' width='50%' /><col style=''  width='50%' />";
                       tabletxt += "<tr><td id='leftbutton' style='text-align:center'>$</td></td><td style='text-align:center'>%</td></tr>";
                       tabletxt += "</table>";

                       this.setContent(tabletxt);
                       // THE FOLLOWING DOES NOT WORK:
                       document.getElementById("leftbutton").style.backgroundColor = "#ff0000";

                   },
                   buildBody: function () {

                   }
               });

Comments

Sign In or Register to comment.