I want to wrap the following code into a function using jQuery and call that function from inline (eg: onclick, onchange etc.).
function some_function() {
alert("Hello world");
}
Called by (example):
<input type="button" id="message" onclick="some_function()" />
This question is simple for a reason. I can't seem to find a proper jQuery how-to.
- Should I wrap that function into a jQuery $(document).ready() ?
- Should make a normal javascript function and use $(document).ready() in that function?