Everything works here but I need to write the code this way:

`<input type='text' class='inpTitle' data-fn = 'write' onkeypress = "???-what here">`

Any help?

```js
$('.inpTitle').on('keypress', function(e){
if(e.keyCode == 13){
let fn = $(this).attr('data-fn');    
window[fn]();
}

});

function write(){
console.log('323');
}
```

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<input type='text' class='inpTitle' data-fn = 'write'>
```