title: Using jQuery to set onkeypress attribute
body: <p>I need to use an external script to set the <code>onkeypress</code> attribute of an input with a unique <code>id</code>. I tried to use <code>$j('#numret').attr('onkeypress', 'calc();');</code>, but this code did not work. Is there a way to alter this attribute externally?</p>