Sure, what you are looking for is jQuery.on() and jQuery.off().
So this is the code for you example.
function onClick (e) {
console.log("content here");
}
var $line = $('#rubber')
.on("click", onClick);
// to remove later
$line.off("click", onClick);
Also check out jQuery.one(), as this attaches a listener to an object and removes it after firing once.