Reputation: 7568
Each time am trying the get the value of an element in my page, I have an error as is undefined: I have tried dijit.byId('myid').innerHTML('loading...');
I get an error
but when i do the same using jquery, it works $('#myid').html('loading ...')
And what is the equivalent of this $('#myid').html()
in dojo?
Thanks for any advise
Upvotes: 8
Views: 9880
Reputation: 111
dijit.byId("my_id") ----> returns the widget associated with the domNode.
dojo.byId("my_id") -----> returns the domNode itself.
dijit.byId("my_id").domNode.innerHTML
Upvotes: 3
Reputation: 31524
dijit.byId
returns a dijit object by some id.
dojo.byId
is the equivalent of $()
. To get/set it's HTML, use
dojo.byId("my_id").innerHTML
dojo.byId("my_id").innerHTML = some_text`
Note that dojo.byId
is just a wrapper around document.getElementById
, so you can use all the basic functions.
Upvotes: 10