Question

i enter dojo.query('input') i get the following :-

 <input id="paragraphtwo" data-dojo-type="dijit/form/SimpleTextarea" rows="4" cols="50" style="width:auto">

now WHEN i write

text= dojo.query('input')
 [<input id="paragraphtwo" data-dojo-type="dijit/form/SimpleTextarea" rows="4" cols="50" style="width:auto">]

gets storeed in text.

now when i write text[0].id i get "paragraphtwo". how can i access the type of input i.e hwo can i get "dijit/form/SimpleTextarea" just like i got the id

Was it helpful?

Solution

One way to this is as follows:

    var input = dojo.byId("paragraphtwo");
    var dojoType = dojo.attr(input, "data-dojo-type"));​
    console.log(dojoType); // Outputs: dijit/form/SimpleTextarea

OTHER TIPS

Using the declaredClass property:

console.log(dijit.byId("paragraphtwo").declaredClass);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top