Dojo Dijit and HTML5 in Real world applications/Dijit/dijit.byId: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
==dijit.byId== | ==dijit.byId== | ||
dijit.byId("id") works almost like document.getElementById("id"). However,it only works on declared dijit elements. See also [[dojo.byId]] | |||
==How to use== | ==How to use== | ||
Line 13: | Line 14: | ||
<input type="text" id="s21" name="result" | <input type="text" id="s21" name="result" | ||
data-dojo-type="dijit.form.TextBox" | data-dojo-type="dijit.form.TextBox" | ||
data-dojo-id=" | data-dojo-id="s21" > | ||
</source> | </source> | ||
Revision as of 20:06, 19 September 2011
dijit.byId
dijit.byId("id") works almost like document.getElementById("id"). However,it only works on declared dijit elements. See also dojo.byId
How to use
Tips and tricks
dijit.byId would not work on HTML elements not specified as an dijit element:
<script type="text/javascript">
dijit.byId('s21').set('value', 'New value for text field') );
</script>
<!-- Remember to declare the destination as a data-dojo-type -->
<input type="text" id="s21" name="result"
data-dojo-type="dijit.form.TextBox"
data-dojo-id="s21" >
Verified in
IE 8, Firefox 3.6.22, Dojo 1.6.1