How do i execute this javascript only after the html is loaded.
<input type="text" id="rmb" name="price" class="price span1" value="2" />
<input type="text" id="sgd" />
$('#rmb').keyup(function(){
$('#sgd').val(Number(this.value/4.7).toFixed(2));
});
inside my .js file , used to detect for submit button clicked
dialogEditItem.one('click', '.submit', function(e){
my jsfiddle http://jsfiddle.net/ZLr9N/
my modal html
<script id="product-data" type="text/html">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3><%= data.name %></h3>
</div>
<div class="modal-body">
...
<input type="text" id="rmb" name="price" class="price span1" value="<%= data.price %>">
<input type="text" id="sgd" />
...
<div class="modal-footer">
<button class="btn green submit">Submit</button>
<button class="btn red cancel" data-dismiss="modal">Cancel</button>
</div>
</script>