For a very simple example, you could update the dataset directly, and put the bar drawing code in a render() function that you can call to re-render the changes.
var dataset = [...];
function render() {
// bind dataset to rects and draw here
}
function clickEvent(d, i) {
var op = prompt("Please enter the value", d);
dataset[i] = parseInt(op, 10);
render();
};
Here's a running example in your code: http://jsfiddle.net/findango/TwEhT/4/