$(document).ready(function() { MyApplication.TestModule.test_id = $('#test-element-with-id'); console.log(MyApplication.TestModule.test_id); });