The function do_something() doesn’t exist in the scope where it’s called in the browser. If you really need access to, the easiest (but not the ideal) solution is to attached it to the window object, which will be available when it executes in the browser, i.e.
window.do_something = function() {
// do something
}
Usually, though, the better solution is to write JS that watches for events instead of using onclick and its bretheren: