str.charAt(0) ... gefällt mir besser...
<script language="javascript">
<!--//
function gener(form) {
var str = sernr;
var str.charAt(5);
var str.charAt(12);
var str.charAt(9);
var str.charAt(13);
var str.charAt(10);
document.getElementByName("code1").innerHTML = res;
}
//-->
</script>
<form>
<input type="text" name="sernr" size="14">
<input type="submit" onClick="gener(this.form)" value="Umwandeln">
<output type="output" name="code1">
</form>