function inside $(document).ready(function(){});

function inside $(document).ready(function(){});

Hi,
I want to have this code
  1. $(document).ready(function(){
  2. function doSomething(){
  3. alert('hello');
  4. }
  5. });
in my HTML code I want to call function which is declared inside $(document.ready()

<div onclick="doSomething();"></div>

but this does not work. How can I call function from html, while function body is declared inside $(document).ready()?
thanks for advise
Tomas